From 514161467f8f2d25ccbb058d7a0554ab8633a494 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 19 Apr 2010 10:19:45 +0000 Subject: [PATCH] LUCENE-2399: speed this filter up 20% (icu optimizes for dest = stringbuilder) git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@935513 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java b/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java index f7e072b89ec..ef14f25d416 100644 --- a/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java +++ b/lucene/contrib/icu/src/java/org/apache/lucene/analysis/icu/ICUNormalizer2Filter.java @@ -80,9 +80,8 @@ public class ICUNormalizer2Filter extends TokenFilter { 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 {