Commits

Maciej Fijalkowski  committed afb4c5c

further speedups

  • Participants
  • Parent commits 5df909d
  • Branches json-decoder-speedups

Comments (0)

Files changed (1)

File lib-python/modified-2.7/json/decoder.py

             raise ValueError(
                 errmsg("Unterminated string starting at", s, begin))
         end = chunk.end()
-        content, terminator = chunk.groups()
-        del chunk
+        content = s[chunk.start(1):chunk.end(1)]
+        terminator = s[chunk.start(2):chunk.end(2)]
+        #content, terminator = chunk.groups()
         # Content is contains zero or more unescaped string characters
         if content:
             if not isinstance(content, unicode):
                 content = unicode(content, encoding)
             chunks.append(content)
-        del content
         # Terminator is the end of string, a literal control character,
         # or a backslash denoting that an escape sequence follows
         if terminator == '"':
             char = unichr(uni)
             end = next_end
         # Append the unescaped character
+        del chunk
+        del content
         chunks.append(char)
     return u''.join(chunks), end