paulirwin commented on code in PR #1064:
URL: https://github.com/apache/lucenenet/pull/1064#discussion_r1884252632


##########
src/Lucene.Net/Index/IndexWriter.cs:
##########
@@ -5144,8 +5145,8 @@ internal bool RegisterMerge(MergePolicy.OneMerge merge)
                         int delCount = NumDeletedDocs(info);
                         if (Debugging.AssertsEnabled) 
Debugging.Assert(delCount <= info.Info.DocCount);
                         double delRatio = ((double)delCount) / 
info.Info.DocCount;
-                        merge.EstimatedMergeBytes += 
(long)(info.GetSizeInBytes() * (1.0 - delRatio));
-                        merge.totalMergeBytes += info.GetSizeInBytes();
+                        _ = 
merge.estimatedMergeBytes.AddAndGet((long)(info.GetSizeInBytes() * (1.0 - 
delRatio)));

Review Comment:
   Regardless of code analysis, given the name of the method `AddAndGet`, I 
feel it is most prudent and responsible to communicate to someone reading the 
code in the future that you're intentionally discarding the result. In this 
case, I don't think there was a CA warning about it (although there have been 
times I've added that to address warnings elsewhere), it's just a practice I 
use when methods clearly indicate they're trying to return a potentially useful 
value, and we want to not use that value.



-- 
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: dev-unsubscr...@lucenenet.apache.org

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

Reply via email to