Permalink
Browse files

Add another useful SCC annotation

This lets us see the cost of string encoding more clearly.
  • Loading branch information...
1 parent 63759d0 commit 74658668022a695119c3bb9b7bb25795940c2562 @bos committed Dec 23, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 Data/Aeson/Encode.hs
View
@@ -55,7 +55,8 @@ fromValue (Object m) = {-# SCC "fromValue/Object" #-}
one (k,v) = string k `mappend` Char8.fromChar ':' `mappend` fromValue v
string :: T.Text -> Builder
-string s = Char8.fromChar '"' `mappend` (quote s) `mappend` Char8.fromChar '"'
+string s = {-# SCC "string" #-}
+ Char8.fromChar '"' `mappend` quote s `mappend` Char8.fromChar '"'
where
quote q = case T.uncons t of
Just (c,t') -> fromText h `mappend` escape c `mappend` quote t'

0 comments on commit 7465866

Please sign in to comment.