SOLR-2275: mm param parsing optimization - fix pattern

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1052301 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-12-23 15:40:46 +00:00
parent 9c61ecdef7
commit 4c363bbdbe

View File

@ -609,7 +609,7 @@ public class SolrPluginUtils {
}
// private static Pattern spaceAroundLessThanPattern = Pattern.compile("\\s*<\\s*");
private static Pattern spaceAroundLessThanPattern = Pattern.compile("(\\s+<)|(<\\s+)|(\\s+<\\s+)");
private static Pattern spaceAroundLessThanPattern = Pattern.compile("(\\s+<\\s*)|(\\s*<\\s+)");
private static Pattern spacePattern = Pattern.compile(" ");
private static Pattern lessThanPattern = Pattern.compile("<");
@ -625,9 +625,8 @@ public class SolrPluginUtils {
if (-1 < spec.indexOf("<")) {
/* we have conditional spec(s) */
spec = spaceAroundLessThanPattern.matcher(spec).replaceAll("<");
for (String s : spacePattern.split(spec)) {
String[] parts = lessThanPattern.split(s);
String[] parts = lessThanPattern.split(s,0);
int upperBound = Integer.parseInt(parts[0]);
if (optionalClauseCount <= upperBound) {
return result;