X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FGSS.java;h=cff543d699845a77aa71ee30ec05570fb724472f;hp=e4859d4513ec6fb8c1d7cdf5e84e23d97be9d949;hb=c366dacc334fe2e35835164f5a37d3eebb2ca6d5;hpb=90500a338733b6ba0d5b9c0cdc5a7afea38173ae;ds=sidebyside diff --git a/src/edu/berkeley/sbp/GSS.java b/src/edu/berkeley/sbp/GSS.java index e4859d4..cff543d 100644 --- a/src/edu/berkeley/sbp/GSS.java +++ b/src/edu/berkeley/sbp/GSS.java @@ -39,7 +39,7 @@ class GSS { public Forest.Ref finalResult; /** all nodes, keyed by the value returned by code() */ - /*private*/ HashMap hash; /* ALLOC */ + /*private*/ IntPairMap hash; /* ALLOC */ /** the number of nodes in this phase */ private int numNodes; @@ -70,7 +70,7 @@ class GSS { tail.clear(); waiting.clear(); performed.clear(); - hash = new HashMap(); + hash = new IntPairMap(); good = false; closed = false; numNodes = 0; @@ -172,7 +172,7 @@ class GSS { * @param start the earliest part of the input contributing to this node (used to make merging decisions) */ public boolean newNode(Node parent, Forest pending, State state, boolean fromEmptyReduction) { - Node p = hash.get(code(state, parent==null?null:parent.phase())); + Node p = hash.get(state, parent==null?null:parent.phase()); if (p != null) return newNode2(p, parent, pending, state, fromEmptyReduction); else return newNode3(parent, pending, state, fromEmptyReduction); } @@ -273,9 +273,8 @@ class GSS { reducing = true; if (reducing_list==null || reducing_list.length < hash.size()) reducing_list = new Phase.Node[hash.size() * 4]; - Collection hv = hash.values(); - hv.toArray(reducing_list); - int num = hv.size(); + hash.toArray(reducing_list); + int num = hash.size(); for(int i=0; i