craigtaverner commented on code in PR #946:
URL: https://github.com/apache/lucene/pull/946#discussion_r892406529


##########
lucene/core/src/java/org/apache/lucene/geo/Tessellator.java:
##########
@@ -817,8 +841,12 @@ private static final boolean splitEarcut(
             sortByMortonWithReset(searchNode);
             sortByMortonWithReset(splitNode);
           }
-          earcutLinkedList(polygon, searchNode, tessellation, State.INIT, 
mortonOptimized);
-          earcutLinkedList(polygon, splitNode, tessellation, State.INIT, 
mortonOptimized);
+          notifyMonitorSplit("SPLIT[" + depth + "]", monitor, searchNode, 
splitNode);

Review Comment:
   Since the split function is called very infrequently (a couple of times for 
an entire tessellation session), I presume this object allocation is negligible 
(note how a few lines later we have `return true` so even though this is a 
while loop, it is called only once).
   
   The option of passing in the depth only and creating the string deeper in 
the stack will result in exactly the same number of object constructions. 
However, I can see the advantage of test code not creating the strings at all. 
Since this is called very little, it is only a tiny saving, but a saving 
nevertheless. I kept it as a string here mainly for symmetry with the other 
functions (notifyMonitor).



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