lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [lucenenet] branch master updated: Lucene.Net.Codecs.Memory.MemoryPostingsFormat: Added additional comments for System.Enum.CompareTo() to IndexOptionsComparer change
Date Thu, 05 Nov 2020 02:52:56 GMT
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/master by this push:
     new 3b13b9e  Lucene.Net.Codecs.Memory.MemoryPostingsFormat: Added additional comments
for System.Enum.CompareTo() to IndexOptionsComparer change
3b13b9e is described below

commit 3b13b9e45b596679c2d54a89ba4c1b9cdaea03d7
Author: Shad Storhaug <shad@shadstorhaug.com>
AuthorDate: Thu Nov 5 09:52:24 2020 +0700

    Lucene.Net.Codecs.Memory.MemoryPostingsFormat: Added additional comments for System.Enum.CompareTo()
to IndexOptionsComparer change
---
 src/Lucene.Net.Codecs/Memory/MemoryPostingsFormat.cs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/Lucene.Net.Codecs/Memory/MemoryPostingsFormat.cs b/src/Lucene.Net.Codecs/Memory/MemoryPostingsFormat.cs
index 3b00359..aa434ee 100644
--- a/src/Lucene.Net.Codecs/Memory/MemoryPostingsFormat.cs
+++ b/src/Lucene.Net.Codecs/Memory/MemoryPostingsFormat.cs
@@ -826,6 +826,7 @@ namespace Lucene.Net.Codecs.Memory
 
             public override DocsAndPositionsEnum DocsAndPositions(IBits liveDocs, DocsAndPositionsEnum
reuse, DocsAndPositionsFlags flags)
             {
+                // LUCENENET specific - to avoid boxing, changed from CompareTo() to IndexOptionsComparer.Compare()
                 bool hasOffsets = IndexOptionsComparer.Default.Compare(field.IndexOptions,
IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;
                 if (IndexOptionsComparer.Default.Compare(field.IndexOptions, IndexOptions.DOCS_AND_FREQS_AND_POSITIONS)
< 0)
                 {
@@ -949,6 +950,7 @@ namespace Lucene.Net.Codecs.Memory
 
             public override IComparer<BytesRef> Comparer => BytesRef.UTF8SortedAsUnicodeComparer;
 
+            // LUCENENET specific - to avoid boxing, changed from CompareTo() to IndexOptionsComparer.Compare()
             public override bool HasFreqs => IndexOptionsComparer.Default.Compare(field.IndexOptions,
IndexOptions.DOCS_AND_FREQS) >= 0;
 
             public override bool HasOffsets => IndexOptionsComparer.Default.Compare(field.IndexOptions,
IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;


Mime
View raw message