RapperCL opened a new issue, #5179:
URL: https://github.com/apache/rocketmq/issues/5179

   1 Math.abs() method call redundant
          The incrementAndGet method of ThreadLocalIndex has made the absolute 
value of the returned result. When acquiring externally, there is no need to 
add the abs method.
          At present, there are inconsistencies in the processing of calling 
this method in the project. In some places, there is no additional absolute 
value, and in some places, the abs method is additionally added.
   
![image](https://user-images.githubusercontent.com/44110731/191930637-17ff9757-a90a-4421-b654-f2a244efa0de.png)
   
         for example:
                            Where additionally the Math.abs() method is added:
            
   
![image](https://user-images.githubusercontent.com/44110731/191930692-307fe9aa-e3ec-4505-996e-27c1ee1d2b3b.png)
                            Where the Math.abs() method is not additionally 
added:
   
![image](https://user-images.githubusercontent.com/44110731/191930874-bdd3e1b0-3448-4766-81a4-326279aea5ea.png)
   
   2  redundant judgment
    pos will not be less than 0
   
![image](https://user-images.githubusercontent.com/44110731/191931094-591120f1-b612-4f63-ba0a-e8b72dffef00.png)
   
   3 repeated assignment
   
   
![image](https://user-images.githubusercontent.com/44110731/191931353-6db7819c-abcf-4e81-9f71-b901e19887b9.png)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to