You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2021/02/04 11:18:39 UTC

[GitHub] [lucenenet] eladmarg commented on a change in pull request #410: remove facetconfig locks

eladmarg commented on a change in pull request #410:
URL: https://github.com/apache/lucenenet/pull/410#discussion_r570144168



##########
File path: src/Lucene.Net.Facet/FacetsConfig.cs
##########
@@ -157,17 +153,14 @@ public virtual DimConfig GetDimConfig(string dimName)
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public virtual void SetHierarchical(string dimName, bool v)
         {
-            lock (syncLock)
+            // LUCENENET: Eliminated extra lookup by using TryGetValue instead of ContainsKey
+            if (!fieldTypes.TryGetValue(dimName, out DimConfig fieldType))

Review comment:
       totally agree




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org