From 884cc9004b6dde0d2f67ede913e72e20472d5e05 Mon Sep 17 00:00:00 2001 From: Shai Erera Date: Tue, 22 Oct 2013 21:05:58 +0000 Subject: [PATCH] minor optimization git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1534787 13f79535-47bb-0310-9956-ffa450edef68 --- .../facet/taxonomy/directory/TaxonomyIndexArrays.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/TaxonomyIndexArrays.java b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/TaxonomyIndexArrays.java index 62e7858a4fb..a06bca30f6f 100644 --- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/TaxonomyIndexArrays.java +++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/TaxonomyIndexArrays.java @@ -90,13 +90,15 @@ class TaxonomyIndexArrays extends ParallelTaxonomyArrays { // called from the ctor, after we know copyFrom has initialized children/siblings System.arraycopy(copyFrom.children(), 0, children, 0, copyFrom.children().length); System.arraycopy(copyFrom.siblings(), 0, siblings, 0, copyFrom.siblings().length); + computeChildrenSiblings(copyFrom.parents.length); + } else { + computeChildrenSiblings(0); } - computeChildrenSiblings(parents, 0); initializedChildren = true; } } - private void computeChildrenSiblings(int[] parents, int first) { + private void computeChildrenSiblings(int first) { // reset the youngest child of all ordinals. while this should be done only // for the leaves, we don't know up front which are the leaves, so we reset // all of them.