[MLton-commit] r6188

Vesa Karvonen vesak at mlton.org
Tue Nov 20 01:41:05 PST 2007


Avoid one queue reversal.
----------------------------------------------------------------------

U   mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml

----------------------------------------------------------------------

Modified: mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml
===================================================================
--- mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml	2007-11-20 08:47:48 UTC (rev 6187)
+++ mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml	2007-11-20 09:41:03 UTC (rev 6188)
@@ -48,13 +48,13 @@
            of [] => error ["Each lib must be used as a unique .use file"]
             | e::es => (useQueue := es ; e)
       fun pushLib () =
-          (libStack := rev (!useQueue) :: !libStack
+          (libStack := !useQueue :: !libStack
          ; useQueue := [])
       fun popLib () =
           case !libStack
            of [] => error ["Internal error: Unmatched popLib"]
             | e::es => (libStack := es
-                      ; useQueue := !useQueue @ e)
+                      ; useQueue := List.revAppend (!useQueue, e))
       fun clear () = (libStack := [] ; useQueue := [])
    end
 




More information about the MLton-commit mailing list