Merge pull request #379 from awhitford/HashSetLen

Sized the new HashSet to avoid rehashing risk.
This commit is contained in:
Jeremy Long
2015-10-12 06:46:12 -04:00
2 changed files with 6 additions and 10 deletions

View File

@@ -214,7 +214,7 @@ public abstract class AbstractFileTypeAnalyzer extends AbstractAnalyzer implemen
* @return a Set of strings.
*/
protected static Set<String> newHashSet(String... strings) {
final Set<String> set = new HashSet<String>();
final Set<String> set = new HashSet<String>(strings.length);
Collections.addAll(set, strings);
return set;
}