[commit: ghc] master: Delete duplicate definition of fingerprintByteString (9ded0d6)

git at git.haskell.org git at git.haskell.org
Wed May 30 14:02:34 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9ded0d6cd43737fa414a99582c2702237249bab0/ghc

>---------------------------------------------------------------

commit 9ded0d6cd43737fa414a99582c2702237249bab0
Author: Simon Jakobi <simon.jakobi at gmail.com>
Date:   Sun May 27 01:19:52 2018 +0200

    Delete duplicate definition of fingerprintByteString


>---------------------------------------------------------------

9ded0d6cd43737fa414a99582c2702237249bab0
 compiler/basicTypes/Module.hs | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/compiler/basicTypes/Module.hs b/compiler/basicTypes/Module.hs
index 5b198b3..e4dc1a8 100644
--- a/compiler/basicTypes/Module.hs
+++ b/compiler/basicTypes/Module.hs
@@ -151,13 +151,10 @@ import Util
 import Data.List
 import Data.Ord
 import GHC.PackageDb (BinaryStringRep(..), DbUnitIdModuleRep(..), DbModule(..), DbUnitId(..))
+import Fingerprint
 
 import qualified Data.ByteString as BS
-import qualified Data.ByteString.Unsafe as BS
 import qualified Data.ByteString.Char8 as BS.Char8
-import System.IO.Unsafe
-import Foreign.Ptr (castPtr)
-import GHC.Fingerprint
 import Encoding
 
 import qualified Text.ParserCombinators.ReadP as Parse
@@ -847,11 +844,6 @@ rawHashUnitId sorted_holes =
           fastStringToByteString (unitIdFS (moduleUnitId b)), BS.Char8.singleton ':',
           toStringRep (moduleName b),   BS.Char8.singleton '\n']
 
-fingerprintByteString :: BS.ByteString -> Fingerprint
-fingerprintByteString bs = unsafePerformIO
-                         . BS.unsafeUseAsCStringLen bs
-                         $ \(p,l) -> fingerprintData (castPtr p) l
-
 fingerprintUnitId :: BS.ByteString -> Fingerprint -> BS.ByteString
 fingerprintUnitId prefix (Fingerprint a b)
     = BS.concat



More information about the ghc-commits mailing list