Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/ZoneTree/PresetTypes/TTLValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public override bool Equals(object obj)
public bool Equals(TTLValue<TValue> other)
{
return EqualityComparer<TValue>.Default.Equals(Value, other.Value) &&
Expiration == other.Expiration &&
IsExpired == other.IsExpired;
Expiration == other.Expiration;
}

public void Expire()
Expand All @@ -36,7 +35,10 @@ public void Expire()

public override int GetHashCode()
{
return HashCode.Combine(Value, Expiration, IsExpired);
// IsExpired depends on the current time. Including it in the
// hash code would cause different hashes for the same value
// depending on when GetHashCode is called.
return HashCode.Combine(Value, Expiration);
}

public bool SlideExpiration(TimeSpan timeSpan)
Expand Down
Loading