Skip to content

Commit 6d1daf3

Browse files
committed
in kshingling: profile with initial size...
1 parent a995ee8 commit 6d1daf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/info/debatty/java/stringsimilarity/KShingling.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public final void setK(int k) {
9292
* @return
9393
*/
9494
public HashMap<String, Integer> getProfile(String s) {
95-
HashMap<String, Integer> r = new HashMap<String, Integer>();
95+
HashMap<String, Integer> r = new HashMap<String, Integer>(s.length() / 2);
9696
s = spaceReg.matcher(s).replaceAll(" ");
9797
String kgram;
9898
for (int i = 0; i < (s.length() - k + 1); i++) {

0 commit comments

Comments
 (0)