Author: Antonio Cuni <[email protected]>
Branch: fastjson
Changeset: r64835:fdc8c71594f3
Date: 2013-06-07 11:12 +0200
http://bitbucket.org/pypy/pypy/changeset/fdc8c71594f3/

Log:    apparently, checking for digits at last gives another small speedup

diff --git a/pypy/module/_fastjson/interp_decoder.py 
b/pypy/module/_fastjson/interp_decoder.py
--- a/pypy/module/_fastjson/interp_decoder.py
+++ b/pypy/module/_fastjson/interp_decoder.py
@@ -94,8 +94,6 @@
         ch = self.s[i]
         if ch == '"':
             return self.decode_string(i+1)
-        elif ch.isdigit() or ch == '-':
-            return self.decode_numeric(i)
         elif ch == '[':
             return self.decode_array(i+1)
         elif ch == '{':
@@ -106,6 +104,8 @@
             return self.decode_true(i+1)
         elif ch == 'f':
             return self.decode_false(i+1)
+        elif ch.isdigit() or ch == '-':
+            return self.decode_numeric(i)
         else:
             self._raise("No JSON object could be decoded: unexpected '%s' at 
char %d",
                         ch, self.pos)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to