comparison src/org/tmatesoft/hg/core/Nodeid.java @ 304:85b8efde5586

Use memory-friendly set implementation to canonicalize filenames and nodeids
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 21 Sep 2011 18:26:16 +0200
parents 88c58edc0857
children 465316bf97e8
comparison
equal deleted inserted replaced
303:2ffcbf360fd5 304:85b8efde5586
74 return b[0] << 24 | (b[1] & 0xFF) << 16 | (b[2] & 0xFF) << 8 | (b[3] & 0xFF); 74 return b[0] << 24 | (b[1] & 0xFF) << 16 | (b[2] & 0xFF) << 8 | (b[3] & 0xFF);
75 } 75 }
76 76
77 @Override 77 @Override
78 public boolean equals(Object o) { 78 public boolean equals(Object o) {
79 if (o == this) {
80 return true;
81 }
79 if (o instanceof Nodeid) { 82 if (o instanceof Nodeid) {
80 return this == o || equalsTo(((Nodeid) o).binaryData); 83 return equalsTo(((Nodeid) o).binaryData);
81 } 84 }
82 return false; 85 return false;
83 } 86 }
84 87
85 public boolean equalsTo(byte[] buf) { 88 public boolean equalsTo(byte[] buf) {