Skip to content

Commit

Permalink
Resolve a bug: During hash collison keep track of offsets instead of …
Browse files Browse the repository at this point in the history
…overwriting it

Signed-off-by: Lakshmipathi.G <lakshmipathi.g@collabora.com>
  • Loading branch information
Lakshmipathi.G committed Jul 8, 2020
1 parent db20546 commit 180f2ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dduper
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def get_hashes(out1):
v.append(idx)
if k in od:
print "Collison with: "+str(k) + "at offset: "+str(v)
# Get previous value
v.extend(od.get(k))
od[k] = v
else:
od = OrderedDict()
Expand All @@ -83,6 +85,8 @@ def get_hashes(out1):
v.append(idx)
if k in od:
print "Collison with: "+str(k) + "at offset: "+str(v)
# Get previous value
v.extend(od.get(k))
od[k] = v

return od
Expand Down

0 comments on commit 180f2ae

Please sign in to comment.