Skip to content

Commit

Permalink
[sparql] Put only truncated Sha256Sums into the 'magic' index
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzov committed Nov 22, 2024
1 parent abd3f40 commit d84f739
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,10 @@ class CpIndex(sail: Sail, geo: Future[GeoIndex], data: IndexData)(log: LoggingAd
def lookupObject(hash: Sha256Sum): Option[ObjInfo] = idLookup.get(hash).map(objs.apply)

def getObjEntry(hash: Sha256Sum): ObjEntry = idLookup.get(hash).fold{
val oe = new ObjEntry(hash, objs.length, "")
val canonicalHash = hash.truncate
val oe = new ObjEntry(canonicalHash, objs.length, "")
objs += oe
idLookup += hash -> oe.idx
idLookup += canonicalHash -> oe.idx
oe
}(objs.apply)

Expand Down

0 comments on commit d84f739

Please sign in to comment.