lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [18/23] lucenenet git commit: Lucene.Net.Analysis.Common.Analysis.In.IndicNormalizer: slight optimization on retrieving the ScriptData using TryGetValue
Date Sun, 19 Mar 2017 23:20:13 GMT
Lucene.Net.Analysis.Common.Analysis.In.IndicNormalizer: slight optimization on retrieving the
ScriptData using TryGetValue


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

Branch: refs/heads/api-work
Commit: 7298ecb8f06ad33cda750ed4a0d72bf31aa0a55d
Parents: 8e30095
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Mon Mar 20 02:16:24 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Mon Mar 20 02:16:24 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7298ecb8/src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs b/src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs
index c01e150..a7b14fd 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs
@@ -272,8 +272,8 @@ namespace Lucene.Net.Analysis.In
             for (int i = 0; i < len; i++)
             {
                 var block = GetBlockForChar(text[i]);
-                ScriptData sd = scripts.ContainsKey(block) ? scripts[block] : null;
-                if (sd != null)
+                ScriptData sd;
+                if (scripts.TryGetValue(block, out sd) && sd != null)
                 {
                     int ch = text[i] - sd.@base;
                     if (sd.decompMask.Get(ch))


Mime
View raw message