vlsi commented on PR #6453:
URL: https://github.com/apache/jmeter/pull/6453#issuecomment-2870037262

   There are three types of changes here:
   1) There are valid improvements, and in theory they could make the code a 
tiny bit faster.
   
       ```java
       int columnCount = tableModel.getColumnCount();
       for (int i = 0; i < columnCount; i++) {
       ```
   
   2) There are changes when the loop iteration goes backward. I believe the 
changes are not justified, and they do not affect performance.
   
       ```java
       for (int i = rowsSelected.length - 1; i >= 0; i--) {
       ```
   
   3) There are cases when the loop could be refactored to for-each. I would 
prefer for-each loops rather than manual for loops.
   
   I suggest we should cleanup 2&3 before merging the PR.
   However, what bothers me the most is I can't understand how could one "test" 
the PR. In other words, is there any automation that could detect "suboptimal 
loops" and refactor them to the optimal case?
   The thing is the new code is slightly harder to read, and I could easily 
imagine someone could file a PR that refactors the code to the old style. It 
would be great if there was an automated refactoring to implement the change.


-- 
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...@jmeter.apache.org

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

Reply via email to