[MLton-commit] r7003

Vesa Karvonen vesak at mlton.org
Sun Dec 14 14:46:44 PST 2008


Use ge rather than eq comparison to make overflow check elimination
easier.

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

U   mltonlib/trunk/com/ssh/generic/unstable/detail/value/read.sml

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

Modified: mltonlib/trunk/com/ssh/generic/unstable/detail/value/read.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/detail/value/read.sml	2008-12-14 20:34:09 UTC (rev 7002)
+++ mltonlib/trunk/com/ssh/generic/unstable/detail/value/read.sml	2008-12-14 22:46:44 UTC (rev 7003)
@@ -40,7 +40,7 @@
 
    fun L l = fromReader let
       fun lp i s =
-          if i = size l
+          if i >= size l
           then SOME ((), s)
           else case Sequence.get s
                 of NONE         => NONE
@@ -200,7 +200,7 @@
          val {fromLabel, fromArray} = getP aP 0
          val n = Arg.numElems aP
          fun pl a i =
-             if i = n
+             if i >= n
              then E#")" >> return (fromArray a)
              else case fromLabel i
                    of NONE        => fail "impossible"
@@ -211,7 +211,7 @@
                         then ignored
                         else ignored >> E#"," >> ignored) >> pl a (i+1)))
          fun rl a i =
-             if i = n
+             if i >= n
              then E#"}" >> return (fromArray a)
              else numLabel >>= (fn l =>
                   case fromLabel (valOf (Int.fromString l) - 1)




More information about the MLton-commit mailing list