Permalink
Browse files

small fix

  • Loading branch information...
1 parent c87e3c0 commit 2e5ab71dbb4e897a2ffebbbef309da322a0f4d98 @albertz committed Mar 7, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 Db.h
View
7 Db.h
@@ -36,7 +36,12 @@ struct DbEntry {
assert(haveCompressed());
assert(other.haveSha1());
assert(other.haveCompressed());
- return sha1 == other.sha1 && compressed == other.compressed;
+ if(sha1 != other.sha1) return false;
+ // Note: If we would ensure that the compression algorithm always works exactly
+ // the same way, we could just restrict the check on the compressed data.
+ // But as we don't want to restrict ourself to this, we can't.
+ if(compressed == other.compressed) return true;
+ return data == other.data;
}
};

0 comments on commit 2e5ab71

Please sign in to comment.