Sized the new HashSet to avoid rehashing risk.

This commit is contained in:
Anthony Whitford
2015-10-11 16:51:57 -07:00
parent 38e61ebd8d
commit 5db377923e

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;
}