dweiss commented on a change in pull request #1184: LUCENE-9142 Refactor IntSet 
operations for determinize
URL: https://github.com/apache/lucene-solr/pull/1184#discussion_r368388354
 
 

 ##########
 File path: 
lucene/core/src/java/org/apache/lucene/util/automaton/SortedIntSet.java
 ##########
 @@ -151,126 +141,23 @@ public void computeHash() {
     }
   }
 
+  /**
+   * Create a FrozenIntSet from the current values in this IntSet.
+   *
+   * Note: Must call computeHash() before calling this method
+   *
+   * @param state the state to save
+   * @return a FrozenIntSet that has the same values and hashCode as this set
+   */
   public FrozenIntSet freeze(int state) {
     final int[] c = new int[upto];
     System.arraycopy(values, 0, c, 0, upto);
 
 Review comment:
   You look at Java code but the difference is that Array.copyOf is (I believe) 
an jvm intrinsic so it should be replaced with a more optimized code. The pair 
of allocation+arraycopy should as well be optimized for that matter but it 
requires execution graph analysis and copyOf is straightforward.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to