summaryrefslogtreecommitdiff
path: root/src/cli/runtime/APersistentArray.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/runtime/APersistentArray.cs')
-rw-r--r--src/cli/runtime/APersistentArray.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/cli/runtime/APersistentArray.cs b/src/cli/runtime/APersistentArray.cs
index de9b548c..b78f502d 100644
--- a/src/cli/runtime/APersistentArray.cs
+++ b/src/cli/runtime/APersistentArray.cs
@@ -36,7 +36,7 @@ override public bool Equals(Object obj) {
if(obj is IPersistentArray)
{
IPersistentArray ma = (IPersistentArray) obj;
- if(ma.count() != count())
+ if (ma.count() != count() || ma.GetHashCode() != GetHashCode())
return false;
for(int i=0;i<count();i++)
{
@@ -48,11 +48,14 @@ override public bool Equals(Object obj) {
{
if(!(obj is Sequential))
return false;
- for(ISeq s = seq(), ms = ((IPersistentCollection)obj).seq();s!=null;s = s.rest(), ms = ms.rest())
- {
- if(ms == null || !RT.equal(s.first(),ms.first()))
- return false;
- }
+ ISeq ms = ((IPersistentCollection)obj).seq();
+ for (int i = 0; i < count(); i++, ms = ms.rest())
+ {
+ if (ms == null || !RT.equal(nth(i), ms.first()))
+ return false;
+ }
+ if(ms.rest() != null)
+ return false;
}
return true;