Skip to content

Commit 35e6213

Browse files
committed
Исправление ошибки в сравнении для индексов
1 parent 07f6cec commit 35e6213

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/OneScript.Core/Values/BslUndefinedValue.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*----------------------------------------------------------
2-
This Source Code Form is subject to the terms of the
3-
Mozilla Public License, v.2.0. If a copy of the MPL
4-
was not distributed with this file, You can obtain one
2+
This Source Code Form is subject to the terms of the
3+
Mozilla Public License, v.2.0. If a copy of the MPL
4+
was not distributed with this file, You can obtain one
55
at http://mozilla.org/MPL/2.0/.
66
----------------------------------------------------------*/
77

@@ -24,6 +24,11 @@ public override bool Equals(BslValue other)
2424
return ReferenceEquals(Instance, other);
2525
}
2626

27+
public override int GetHashCode()
28+
{
29+
return 42; // Константа для синглтона
30+
}
31+
2732
public override string ToString() => string.Empty;
2833
}
2934
}

src/OneScript.StandardLibrary/Collections/Indexes/CollectionIndexKey.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public override bool Equals(object obj)
5757
foreach (var key in allKeys)
5858
{
5959
var thisValue = _values[key];
60-
var otherValue = _values[key];
60+
var otherValue = casted._values[key];
6161

6262
if (!thisValue.Equals(otherValue)) return false;
6363
}

0 commit comments

Comments
 (0)