Fix unnecessary application of Math.abs()
This commit is contained in:
parent
b4764f6164
commit
532672deae
@ -42,10 +42,13 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
||||
* non-negative integers are allowed.
|
||||
*/
|
||||
private static Integer allocateId(Channel channel) {
|
||||
int idVal = -Math.abs(System.identityHashCode(channel));
|
||||
if (idVal >= 0) {
|
||||
int idVal = System.identityHashCode(channel);
|
||||
if (idVal > 0) {
|
||||
idVal = -idVal;
|
||||
} else if (idVal == 0) {
|
||||
idVal = -1;
|
||||
}
|
||||
|
||||
Integer id;
|
||||
for (;;) {
|
||||
id = Integer.valueOf(idVal);
|
||||
|
Loading…
Reference in New Issue
Block a user