lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r935513 - /lucene/dev/trunk/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java
Date Mon, 19 Apr 2010 10:19:45 GMT
Author: rmuir
Date: Mon Apr 19 10:19:45 2010
New Revision: 935513

URL: http://svn.apache.org/viewvc?rev=935513&view=rev
Log:
LUCENE-2399: speed this filter up 20% (icu optimizes for dest = stringbuilder)

Modified:
    lucene/dev/trunk/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java

Modified: lucene/dev/trunk/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java?rev=935513&r1=935512&r2=935513&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java
(original)
+++ lucene/dev/trunk/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java
Mon Apr 19 10:19:45 2010
@@ -80,9 +80,8 @@ public class ICUNormalizer2Filter extend
     if (input.incrementToken()) {
       if (normalizer.quickCheck(termAtt) != Normalizer.YES) {
         buffer.setLength(0);
-        buffer.append(termAtt.buffer(), 0, termAtt.length());
-        termAtt.setEmpty();
-        normalizer.normalize(buffer, termAtt);
+        normalizer.normalize(termAtt, buffer);
+        termAtt.setEmpty().append(buffer);
       }
       return true;
     } else {



Mime
View raw message