Skip to content

Commit 241f6d6

Browse files
authored
Merge pull request #936 from TeofilC/remove-scc-pragmas
Remove SCC pragmas
2 parents 79214bf + 05b3745 commit 241f6d6

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Data/Aeson/Parser/Internal.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ json' = value'
133133
-- mkObject outside of the recursive loop for proper inlining.
134134

135135
object_ :: ([(Key, Value)] -> Either String Object) -> Parser Value -> Parser Value
136-
object_ mkObject val = {-# SCC "object_" #-} Object <$> objectValues mkObject key val
136+
object_ mkObject val = Object <$> objectValues mkObject key val
137137
{-# INLINE object_ #-}
138138

139139
object_' :: ([(Key, Value)] -> Either String Object) -> Parser Value -> Parser Value
140-
object_' mkObject val' = {-# SCC "object_'" #-} do
140+
object_' mkObject val' = do
141141
!vals <- objectValues mkObject key' val'
142142
return (Object vals)
143143
where
@@ -172,11 +172,11 @@ objectValues mkObject str val = do
172172
{-# INLINE objectValues #-}
173173

174174
array_ :: Parser Value -> Parser Value
175-
array_ val = {-# SCC "array_" #-} Array <$> arrayValues val
175+
array_ val = Array <$> arrayValues val
176176
{-# INLINE array_ #-}
177177

178178
array_' :: Parser Value -> Parser Value
179-
array_' val = {-# SCC "array_'" #-} do
179+
array_' val = do
180180
!vals <- arrayValues val
181181
return (Array vals)
182182
{-# INLINE array_' #-}
@@ -344,7 +344,7 @@ jstring_ = do
344344

345345
jstringSlow :: B.ByteString -> Parser Text
346346
{-# INLINE jstringSlow #-}
347-
jstringSlow s' = {-# SCC "jstringSlow" #-} do
347+
jstringSlow s' = do
348348
s <- A.scan startState go <* A.anyWord8
349349
case unescapeText (B.append s' s) of
350350
Right r -> return r

src/Data/Aeson/Text.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,31 @@ encodeToTextBuilder :: ToJSON a => a -> Builder
5656
encodeToTextBuilder =
5757
go . toJSON
5858
where
59-
go Null = {-# SCC "go/Null" #-} "null"
60-
go (Bool b) = {-# SCC "go/Bool" #-} if b then "true" else "false"
61-
go (Number s) = {-# SCC "go/Number" #-} fromScientific s
62-
go (String s) = {-# SCC "go/String" #-} string s
59+
go Null = "null"
60+
go (Bool b) = if b then "true" else "false"
61+
go (Number s) = fromScientific s
62+
go (String s) = string s
6363
go (Array v)
64-
| V.null v = {-# SCC "go/Array" #-} "[]"
65-
| otherwise = {-# SCC "go/Array" #-}
64+
| V.null v = "[]"
65+
| otherwise =
6666
TB.singleton '[' <>
6767
go (V.unsafeHead v) <>
6868
V.foldr f (TB.singleton ']') (V.unsafeTail v)
6969
where f a z = TB.singleton ',' <> go a <> z
70-
go (Object m) = {-# SCC "go/Object" #-}
70+
go (Object m) =
7171
case KM.toList m of
7272
(x:xs) -> TB.singleton '{' <> one x <> foldr f (TB.singleton '}') xs
7373
_ -> "{}"
7474
where f a z = TB.singleton ',' <> one a <> z
7575
one (k,v) = string (Key.toText k) <> TB.singleton ':' <> go v
7676

7777
string :: T.Text -> Builder
78-
string s = {-# SCC "string" #-} TB.singleton '"' <> quote s <> TB.singleton '"'
78+
string s = TB.singleton '"' <> quote s <> TB.singleton '"'
7979
where
8080
quote q = case T.uncons t of
8181
Nothing -> TB.fromText h
8282
Just (!c,t') -> TB.fromText h <> escape c <> quote t'
83-
where (h,t) = {-# SCC "break" #-} T.break isEscape q
83+
where (h,t) = T.break isEscape q
8484
isEscape c = c == '\"' ||
8585
c == '\\' ||
8686
c < '\x20'

0 commit comments

Comments
 (0)