Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8152

Simplify conditionals in JoinUtil

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.3, 8.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      The following could be simplified, on line 249:

      int dvDocID = numericDocValues.docID();
      if (dvDocID < doc) {
        dvDocID = numericDocValues.advance(doc);
      }
      long value;
      if (dvDocID == doc) {
        value = numericDocValues.longValue();
      } else {
        value = 0;
      }
      

      To:

      long value = 0;
      if (numericDocValues.advanceExact(doc)) {
        value = numericDocValues.longValue();
      }
      

        Attachments

        1. LUCENE-8152.patch
          1 kB
          Horatiu Lazu
        2. LUCENE-8152.patch
          22 kB
          Horatiu Lazu

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                MathBunny Horatiu Lazu
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h