Revert "cache the serialization of a Key"
This reverts commit 4536c93bb2
.
That broke Read/Show of a Key, and unfortunately Key is read in at least
one place; the GitAnnexDistribution data type.
It would be worth bringing this optimisation back, but it would need
either a custom Read/Show instance that preserves back-compat, or
wrapping Key in a data type that contains the serialization, or changing
how GitAnnexDistribution is serialized.
Also, the Eq instance would need to compare keys with and without a
cached seralization the same.
This commit is contained in:
parent
863ed51ae0
commit
96aba8eff7
12 changed files with 19 additions and 52 deletions
|
@ -10,7 +10,7 @@ module Annex.VariantFile where
|
|||
import Annex.Common
|
||||
import Utility.Hash
|
||||
|
||||
import qualified Data.ByteString as S
|
||||
import qualified Data.ByteString.Lazy as L
|
||||
|
||||
variantMarker :: String
|
||||
variantMarker = ".variant-"
|
||||
|
@ -41,5 +41,5 @@ variantFile file key
|
|||
where
|
||||
doubleconflict = variantMarker `isInfixOf` file
|
||||
|
||||
shortHash :: S.ByteString -> String
|
||||
shortHash = take 4 . show . md5s
|
||||
shortHash :: L.ByteString -> String
|
||||
shortHash = take 4 . show . md5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue