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

Simplify conditionals in JoinUtil

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 7.3, 8.0
    • None
    • None
    • 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

              Unassigned Unassigned
              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