Add fast check for common case
package org.bouncycastle.jsse.provider;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Pattern;
public Set<String> decompose(String algorithm)
{
+ if (algorithm.indexOf('/') < 0)
+ {
+ return Collections.emptySet();
+ }
+
Set<String> result = new HashSet<String>();
for (String section : algorithm.split("/"))
}
}
- result.remove(algorithm);
-
- if (!result.isEmpty())
- {
ensureBothIfEither(result, "SHA1", "SHA-1");
ensureBothIfEither(result, "SHA224", "SHA-224");
ensureBothIfEither(result, "SHA256", "SHA-256");
ensureBothIfEither(result, "SHA384", "SHA-384");
ensureBothIfEither(result, "SHA512", "SHA-512");
- }
return result;
}
