Skip to content

Commit

Permalink
PatriciaTrie constructor reuse the stateless singleton
Browse files Browse the repository at this point in the history
StringKeyAnalyzer.INSTANCE
  • Loading branch information
garydgregory committed Jun 23, 2024
1 parent 8eba18b commit 6c609f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<action type="fix" dev="ggregory" due-to="Gary Gregory">Package private AbstractEmptyIterator implements ResettableIterator so subclasses don't.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate AbstractEmptyIterator.add(E) without replacement.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Add missing Javadocs.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">PatriciaTrie constructor reuse the stateless singleton StringKeyAnalyzer.INSTANCE.</action>
<!-- ADD -->
<!-- UPDATE -->
</release>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public class PatriciaTrie<V> extends AbstractPatriciaTrie<String, V> {
private static final long serialVersionUID = 4446367780901817838L;

public PatriciaTrie() {
super(new StringKeyAnalyzer());
super(StringKeyAnalyzer.INSTANCE);
}

public PatriciaTrie(final Map<? extends String, ? extends V> m) {
super(new StringKeyAnalyzer(), m);
super(StringKeyAnalyzer.INSTANCE, m);
}

}

0 comments on commit 6c609f0

Please sign in to comment.