Commits

Bryan O'Sullivan committed 28ad6f5

Improve parser performance almost 2x for unescaped text.

  • Participants
  • Parent commits ce6387a

Comments (0)

Files changed (1)

Data/Aeson/Parser.hs

                                         then Nothing
                                         else Just (c == backslash)
   _ <- A.word8 doubleQuote
-  (decodeUtf8 . B.concat) <$> reparse unescape s
+  if backslash `B.elem` s
+    then (decodeUtf8 . B.concat) <$> reparse unescape s
+    else return (decodeUtf8 s)
 
 reparse :: Parser a -> ByteString -> Parser a
 reparse p s = case (case parse p s of {Partial k -> k ""; r -> r}) of