lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [15/16] lucenenet git commit: fix for dictionary getter (assume nulls in results)
Date Tue, 25 Nov 2014 18:52:16 GMT
fix for dictionary getter (assume nulls in results)

Closes #23


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

Branch: refs/heads/master
Commit: 5912eabc1f783f75f8335656c56281af665559fa
Parents: 0735c94
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Tue Nov 25 20:50:29 2014 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Tue Nov 25 20:50:29 2014 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Support/ConcurrentHashMapWrapper.cs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5912eabc/src/Lucene.Net.Core/Support/ConcurrentHashMapWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/ConcurrentHashMapWrapper.cs b/src/Lucene.Net.Core/Support/ConcurrentHashMapWrapper.cs
index 6358b69..4d5110f 100644
--- a/src/Lucene.Net.Core/Support/ConcurrentHashMapWrapper.cs
+++ b/src/Lucene.Net.Core/Support/ConcurrentHashMapWrapper.cs
@@ -107,7 +107,10 @@ namespace Lucene.Net.Support
                 _lock.EnterReadLock();
                 try
                 {
-                    return _dict[key];
+                    TValue result;
+                    if (!_dict.TryGetValue(key, out result))
+                        return default(TValue);
+                    return result;
                 }
                 finally
                 {


Mime
View raw message