diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-04-17 12:26:56 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-17 20:34:40 -0400 |
commit | 1cc82d38759c7a5f527ccc6cb514b8ba576cc3d1 (patch) | |
tree | dae54e5e992c487cc9d2d1a2ea435ef25952c826 /compiler/utils/StringBuffer.hs | |
parent | 3d3975f2f4caf3af76a7ea27d2882ddaee7db3c9 (diff) | |
download | haskell-1cc82d38759c7a5f527ccc6cb514b8ba576cc3d1.tar.gz |
utils: Lazily decode UTF8 strings
Reviewers: austin, hvr
Subscribers: rwbarton, thomie
GHC Trac Issues: #13527
Differential Revision: https://phabricator.haskell.org/D3442
Diffstat (limited to 'compiler/utils/StringBuffer.hs')
-rw-r--r-- | compiler/utils/StringBuffer.hs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/utils/StringBuffer.hs b/compiler/utils/StringBuffer.hs index ec5184a1c2..fcc344554b 100644 --- a/compiler/utils/StringBuffer.hs +++ b/compiler/utils/StringBuffer.hs @@ -251,9 +251,7 @@ lexemeToString :: StringBuffer -> String lexemeToString _ 0 = "" lexemeToString (StringBuffer buf _ cur) bytes = - inlinePerformIO $ - withForeignPtr buf $ \ptr -> - utf8DecodeString (ptr `plusPtr` cur) bytes + utf8DecodeStringLazy buf cur bytes lexemeToFastString :: StringBuffer -> Int -- ^ @n@, the number of bytes |