Skip to content
This repository
Browse code

Tiny perf tweaks

  • Loading branch information...
commit 991b32d2bc388ecedcaaf08faf37a4cfd5197c57 1 parent 24ede99
Bryan O'Sullivan authored December 23, 2011

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  Data/Aeson/Encode.hs
4  Data/Aeson/Encode.hs
... ...
@@ -1,4 +1,4 @@
1  
-{-# LANGUAGE OverloadedStrings #-}
  1
+{-# LANGUAGE BangPatterns, OverloadedStrings #-}
2 2
 
3 3
 -- |
4 4
 -- Module:      Data.Aeson.Encode
@@ -63,7 +63,7 @@ string s = {-# SCC "string" #-} singleton '"' <> quote s <> singleton '"'
63 63
   where
64 64
     quote q = case T.uncons t of
65 65
                 Nothing     -> fromText h
66  
-                Just (c,t') -> fromText h <> escape c <> quote t'
  66
+                Just (!c,t') -> fromText h <> escape c <> quote t'
67 67
         where (h,t) = {-# SCC "break" #-} T.break isEscape q
68 68
     isEscape c = c == '\"' || c == '\\' || c < '\x20'
69 69
     escape '\"' = "\\\""

0 notes on commit 991b32d

Please sign in to comment.
Something went wrong with that request. Please try again.