lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [23/50] [abbrv] lucenenet git commit: Fixed "key not found" bug in Facet.Taxonomy.WriterCache.NameIntCacheLRU
Date Tue, 23 Aug 2016 23:18:16 GMT
Fixed "key not found" bug in Facet.Taxonomy.WriterCache.NameIntCacheLRU


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

Branch: refs/heads/analysis-work
Commit: 5b48b115cf9c6a1f4885827febcc78089a2fa408
Parents: 1fa4ed9
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Aug 21 07:57:56 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Aug 21 07:57:56 2016 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Facet/Taxonomy/WriterCache/NameIntCacheLRU.cs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5b48b115/src/Lucene.Net.Facet/Taxonomy/WriterCache/NameIntCacheLRU.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/WriterCache/NameIntCacheLRU.cs b/src/Lucene.Net.Facet/Taxonomy/WriterCache/NameIntCacheLRU.cs
index cd01527..ce14f49 100644
--- a/src/Lucene.Net.Facet/Taxonomy/WriterCache/NameIntCacheLRU.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/WriterCache/NameIntCacheLRU.cs
@@ -75,7 +75,8 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
 
         internal virtual int? Get(FacetLabel name)
         {
-            int? res = cache[Key(name)];
+            object key = Key(name);
+            int? res = cache.ContainsKey(key) ? cache[key] : null;
             if (res == null)
             {
                 nMisses++;


Mime
View raw message