[pypy-commit] pypy json-decoder-maps: fix two, add one reply

cfbolz pypy.commits at gmail.com
Thu Sep 19 14:08:52 EDT 2019


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: json-decoder-maps
Changeset: r97545:863872b6a655
Date: 2019-09-19 20:01 +0200
http://bitbucket.org/pypy/pypy/changeset/863872b6a655/

Log:	fix two, add one reply

diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py
--- a/pypy/module/_pypyjson/interp_decoder.py
+++ b/pypy/module/_pypyjson/interp_decoder.py
@@ -394,6 +394,9 @@
     def _switch_to_dict(self, currmap, values_w, nextindex):
         # <antocuni> not sure if this is a problem, but it's something which I
         # noticed and I think it's worth thinking about it for 5 minutes.
+        # <cfbolz> are you also concerned about the fact that jsonmap dicts
+        # have their keys in the opposite order generally? or just the weird
+        # "c b a | d e f" effect?
         #
         # In Python3 dicts preserve the order of keys; this means that a
         # "naive" json parser produces dicts whose keys are in the same order
@@ -1081,8 +1084,8 @@
                 self.cache_hits * JSONDecoder.STRING_CACHE_USEFULNESS_FACTOR < self.decoded_strings)
 
     def key_repr_cmp(self, ll_chars, i):
-        # <antocuni> isn't there a way to use a "real" strcmp/memcmp? Maybe
-        # (ab)using llstr/rstr._get_raw_buf or similar?
+        # XXX should we use "real" memcmp (here in particular, and in other
+        # places in RPython in general)?
         for j, c in enumerate(self.key_repr):
             if ll_chars[i] != c:
                 return False


More information about the pypy-commit mailing list