stefanvodita commented on code in PR #12454:
URL: https://github.com/apache/lucene/pull/12454#discussion_r1278280338


##########
lucene/facet/src/java/org/apache/lucene/facet/sortedset/DefaultSortedSetDocValuesReaderState.java:
##########
@@ -233,13 +239,13 @@ private int createOneFlatFacetDimState(SortedSetDocValues 
dv, int dimStartOrd)
   /** Return the memory usage of this object in bytes. Negative values are 
illegal. */
   @Override
   public long ramBytesUsed() {
-    synchronized (cachedOrdMaps) {
-      long bytes = 0;
-      for (OrdinalMap map : cachedOrdMaps.values()) {
-        bytes += map.ramBytesUsed();
+    synchronized (cachedOrdMap) {

Review Comment:
   We might not need this synchronization. Because the map has one entry at 
most and we're only writing it once, I don't think we can end up in an invalid 
state here, but it seemes wiser not to rely on that.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to