| 53 | } |
| 54 | |
| 55 | static public boolean mapEquals(IPersistentMap m1, Object obj){ |
| 56 | if(m1 == obj) return true; |
| 57 | if(!(obj instanceof Map)) |
| 58 | return false; |
| 59 | Map m = (Map) obj; |
| 60 | |
| 61 | if(m.size() != m1.count()) |
| 62 | return false; |
| 63 | |
| 64 | for(ISeq s = m1.seq(); s != null; s = s.next()) |
| 65 | { |
| 66 | Map.Entry e = (Map.Entry) s.first(); |
| 67 | boolean found = m.containsKey(e.getKey()); |
| 68 | |
| 69 | if(!found || !Util.equals(e.getValue(), m.get(e.getKey()))) |
| 70 | return false; |
| 71 | } |
| 72 | |
| 73 | return true; |
| 74 | } |
| 75 | |
| 76 | public boolean equiv(Object obj){ |
| 77 | if(!(obj instanceof Map)) |