Commits

Bryan O'Sullivan committed 90c5736

Tiny perf tweaks

Comments (0)

Files changed (1)

Data/Aeson/Encode.hs

-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE BangPatterns, OverloadedStrings #-}
 
 -- |
 -- Module:      Data.Aeson.Encode
   where
     quote q = case T.uncons t of
                 Nothing     -> fromText h
-                Just (c,t') -> fromText h <> escape c <> quote t'
+                Just (!c,t') -> fromText h <> escape c <> quote t'
         where (h,t) = {-# SCC "break" #-} T.break isEscape q
     isEscape c = c == '\"' || c == '\\' || c < '\x20'
     escape '\"' = "\\\""