# HG changeset patch # User Artem Tikhomirov # Date 1295918766 -3600 # Node ID 5f9635c016819b322ae05a91b3378621b538c933 # Parent c25c5c348d1bcdd8764bd0ea708427f4281cbd69 TreeMap are more effective when keys are unique diff -r c25c5c348d1b -r 5f9635c01681 src/org/tmatesoft/hg/repo/HgDataFile.java --- a/src/org/tmatesoft/hg/repo/HgDataFile.java Tue Jan 25 02:13:53 2011 +0100 +++ b/src/org/tmatesoft/hg/repo/HgDataFile.java Tue Jan 25 02:26:06 2011 +0100 @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; +import java.util.TreeMap; import org.tmatesoft.hg.core.Nodeid; import org.tmatesoft.hg.core.Path; @@ -192,8 +192,8 @@ private static class Metadata { // XXX sparse array needed - private final HashMap offsets = new HashMap(5); - private final HashMap entries = new HashMap(5); + private final TreeMap offsets = new TreeMap(); + private final TreeMap entries = new TreeMap(); boolean known(int revision) { return offsets.containsKey(revision); }