From 5790a67a08c77fcc5c87e5840f61fb46db2b814d Mon Sep 17 00:00:00 2001 From: Dave Brosius Date: Fri, 6 May 2016 19:35:37 -0400 Subject: [PATCH] remove dead/useless allocations --- .../twittertools/index/ExtractTermStatisticsFromIndex.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/twitter-tools-core/src/main/java/cc/twittertools/index/ExtractTermStatisticsFromIndex.java b/twitter-tools-core/src/main/java/cc/twittertools/index/ExtractTermStatisticsFromIndex.java index 1b6c57c..8e6cc08 100644 --- a/twitter-tools-core/src/main/java/cc/twittertools/index/ExtractTermStatisticsFromIndex.java +++ b/twitter-tools-core/src/main/java/cc/twittertools/index/ExtractTermStatisticsFromIndex.java @@ -76,11 +76,9 @@ public static void main(String[] args) throws Exception { long missingCnt = 0; int skippedTerms = 0; - BytesRef bytes = new BytesRef(); + BytesRef bytes; while ( (bytes = termsEnum.next()) != null) { - byte[] buf = new byte[bytes.length]; - System.arraycopy(bytes.bytes, 0, buf, 0, bytes.length); - String term = new String(buf, "UTF-8"); + String term = new String(bytes.bytes, "UTF-8"); int df = termsEnum.docFreq(); long cf = termsEnum.totalTermFreq();