Skip to content

Commit cdfe705

Browse files
committed
fix stringmap
1 parent ce2e679 commit cdfe705

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

source/mir/string_map.d

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ struct StringMap(T, U = uint)
4040
private Impl* implementation;
4141

4242
///
43-
bool opEquals()(const StringMap rhs) const
43+
bool opEquals(const StringMap rhs) const
4444
{
45-
return keys == rhs.keys && values == rhs.values;
45+
if (keys != rhs.keys)
46+
return false;
47+
if (implementation)
48+
foreach (const i; 0 .. implementation._length)
49+
if (implementation._values[i] != rhs.implementation._values[i])
50+
return false;
51+
return true;
4652
}
4753

4854
// // linking bug
@@ -118,7 +124,7 @@ struct StringMap(T, U = uint)
118124
}
119125

120126
///
121-
string toString() const
127+
string toString()() const
122128
{
123129
import mir.format: stringBuf;
124130
stringBuf buffer;

0 commit comments

Comments
 (0)