You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2023/12/07 14:03:18 UTC

(lucene) branch main updated: SlowCompositeCodecWrapper: remove redundant FieldInfo lookup in its PointsReader.getValues method

This is an automated email from the ASF dual-hosted git repository.

mikemccand pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new f55f2af0d0c SlowCompositeCodecWrapper: remove redundant FieldInfo lookup in its PointsReader.getValues method
f55f2af0d0c is described below

commit f55f2af0d0ce1e4e438b4fdaea71309ddc4166b9
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Thu Dec 7 09:03:10 2023 -0500

    SlowCompositeCodecWrapper: remove redundant FieldInfo lookup in its PointsReader.getValues method
---
 .../org/apache/lucene/index/SlowCompositeCodecReaderWrapper.java   | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lucene/core/src/java/org/apache/lucene/index/SlowCompositeCodecReaderWrapper.java b/lucene/core/src/java/org/apache/lucene/index/SlowCompositeCodecReaderWrapper.java
index 0376f1e6243..2753b5f7510 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SlowCompositeCodecReaderWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SlowCompositeCodecReaderWrapper.java
@@ -565,12 +565,10 @@ final class SlowCompositeCodecReaderWrapper extends CodecReader {
 
   private static class SlowCompositePointsReaderWrapper extends PointsReader {
 
-    private final CodecReader[] codecReaders;
     private final PointsReader[] readers;
     private final int[] docStarts;
 
     SlowCompositePointsReaderWrapper(CodecReader[] codecReaders, int[] docStarts) {
-      this.codecReaders = codecReaders;
       this.readers =
           Arrays.stream(codecReaders)
               .map(CodecReader::getPointsReader)
@@ -596,12 +594,9 @@ final class SlowCompositeCodecReaderWrapper extends CodecReader {
     public PointValues getValues(String field) throws IOException {
       List<PointValuesSub> values = new ArrayList<>();
       for (int i = 0; i < readers.length; ++i) {
-        FieldInfo fi = codecReaders[i].getFieldInfos().fieldInfo(field);
-        if (fi != null && fi.getPointDimensionCount() > 0) {
+        if (readers[i] != null) {
           PointValues v = readers[i].getValues(field);
           if (v != null) {
-            // Apparently FieldInfo can claim a field has points, yet the returned
-            // PointValues is null
             values.add(new PointValuesSub(v, docStarts[i]));
           }
         }