File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -331,14 +331,11 @@ key = Key.fromText <$> jstring
331
331
jstring_ :: Parser Text
332
332
{-# INLINE jstring_ #-}
333
333
jstring_ = do
334
- -- not sure whether >= or bit hackery is faster
335
- -- perfectly, we shouldn't care, it's compiler job.
336
334
s <- A. takeWhile (\ w -> w /= DOUBLE_QUOTE && w /= BACKSLASH && w >= 0x20 && w < 0x80 )
337
- let txt = unsafeDecodeASCII s
338
335
mw <- A. peekWord8
339
336
case mw of
340
337
Nothing -> fail " string without end"
341
- Just DOUBLE_QUOTE -> A. anyWord8 $> txt
338
+ Just DOUBLE_QUOTE -> A. anyWord8 $> unsafeDecodeASCII s
342
339
Just w | w < 0x20 -> fail " unescaped control character"
343
340
_ -> jstringSlow s
344
341
@@ -354,9 +351,8 @@ jstringSlow s' = do
354
351
go a c
355
352
| a = Just False
356
353
| c == DOUBLE_QUOTE = Nothing
357
- | otherwise = let a' = c == backslash
354
+ | otherwise = let a' = c == BACKSLASH
358
355
in Just a'
359
- where backslash = BACKSLASH
360
356
361
357
decodeWith :: Parser Value -> (Value -> Result a ) -> L. ByteString -> Maybe a
362
358
decodeWith p to s =
You can’t perform that action at this time.
0 commit comments