lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [19/50] lucenenet git commit: Lucene.Net.Core.Codecs.Compressing.CompressingTermVectorsWriter: Use LinkedList.Max instead of Linq Last() for better efficency
Date Thu, 30 Mar 2017 18:00:14 GMT
Lucene.Net.Core.Codecs.Compressing.CompressingTermVectorsWriter: Use LinkedList.Max instead
of Linq Last() for better efficency


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/595697e4
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/595697e4
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/595697e4

Branch: refs/heads/api-work
Commit: 595697e4b5593dcb3f8e098f97778177a553f9a0
Parents: e0318a4
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Thu Mar 30 05:19:13 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Thu Mar 30 09:12:31 2017 +0700

----------------------------------------------------------------------
 .../Codecs/Compressing/CompressingTermVectorsWriter.cs             | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/595697e4/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs b/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs
index f3b729e..042c319 100644
--- a/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs
@@ -455,7 +455,7 @@ namespace Lucene.Net.Codecs.Compressing
 
             int numDistinctFields = fieldNums.Count;
             Debug.Assert(numDistinctFields > 0);
-            int bitsRequired = PackedInt32s.BitsRequired(fieldNums.Last());
+            int bitsRequired = PackedInt32s.BitsRequired(fieldNums.Max);
             int token = (Math.Min(numDistinctFields - 1, 0x07) << 5) | bitsRequired;
             vectorsStream.WriteByte((byte)(sbyte)token);
             if (numDistinctFields - 1 >= 0x07)


Mime
View raw message