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

Remove unused byte order mark in Lucene90PostingsWriter

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 9.0
    • 9.0
    • core/codecs, core/index
    • None
    • New

    Description

      While reviewing the byte order in lucene index, I found the following code in Lucene90PostingsWriter:

      ByteOrder byteOrder = ByteOrder.nativeOrder();
      if (byteOrder == ByteOrder.BIG_ENDIAN) {
        docOut.writeByte((byte) 'B');
      } else if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
        docOut.writeByte((byte) 'L');
      } else {
        throw new Error();
      }
      

      Actually this byte is consumed nowhere, as the file is only used via seeking and the offsets are just 1 larger. We should remove this code.

      Why was this added?

      Attachments

        Issue Links

          Activity

            People

              uschindler Uwe Schindler
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 20m
                  20m