summaryrefslogtreecommitdiff
path: root/Binaries
diff options
context:
space:
mode:
Diffstat (limited to 'Binaries')
-rw-r--r--Binaries/DafnyRuntime.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Binaries/DafnyRuntime.cs b/Binaries/DafnyRuntime.cs
index ef6da67e..a682422a 100644
--- a/Binaries/DafnyRuntime.cs
+++ b/Binaries/DafnyRuntime.cs
@@ -499,7 +499,13 @@ namespace Dafny
return other is Sequence<T> && Equals((Sequence<T>)other);
}
public override int GetHashCode() {
- return elmts.GetHashCode();
+ if (elmts == null || elmts.Length == 0)
+ return 0;
+ var hashCode = 0;
+ for (var i = 0; i < elmts.Length; i++) {
+ hashCode = (hashCode << 3) | (hashCode >> 29) ^ elmts[i].GetHashCode();
+ }
+ return hashCode;
}
public override string ToString() {
if (elmts is char[]) {