From 9c73f9d03b9accd246f345c541c917372cd7320b Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sun, 24 Jul 2011 21:19:42 +0000 Subject: [PATCH] LUCENE-3336: Speed up javadocs-all builds by minimizing compile costs git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1150486 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/build.xml | 9 ++++++++- .../apache/lucene/analysis/en/PorterStemmer.java | 15 +++++++-------- solr/build.xml | 6 +++++- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/lucene/build.xml b/lucene/build.xml index ddd12657b92..e810821f422 100644 --- a/lucene/build.xml +++ b/lucene/build.xml @@ -214,9 +214,16 @@ failonerror="false"/> - + + + + + + + + diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/en/PorterStemmer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/en/PorterStemmer.java index 0b90f0accc8..33aac4bd878 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/en/PorterStemmer.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/en/PorterStemmer.java @@ -49,6 +49,8 @@ import java.io.InputStream; import java.io.FileInputStream; import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_CHAR; + +import org.apache.lucene.analysis.util.StemmerUtil; import org.apache.lucene.util.ArrayUtil; /** @@ -207,15 +209,12 @@ class PorterStemmer } private final boolean ends(String s) { - int l = s.length(); - int o = k-l+1; - if (o < k0) + if (StemmerUtil.endsWith(b, k+1, s)) { + j = k-s.length(); + return true; + } else { return false; - for (int i = 0; i < l; i++) - if (b[o+i] != s.charAt(i)) - return false; - j = k-l; - return true; + } } /* setto(s) sets (j+1),...k to the characters in the string s, readjusting diff --git a/solr/build.xml b/solr/build.xml index 698c3640c92..c1c9b683c1d 100644 --- a/solr/build.xml +++ b/solr/build.xml @@ -379,11 +379,15 @@ - + + + +