Opened 10 years ago

Closed 10 years ago

#437 closed task (fixed)

Superfluous comparisons in DataHelper.eq(byte[], byte[])

Reported by: John Doo Owned by:
Priority: trivial Milestone: 0.8.5
Component: api/data Version: 0.8.4
Keywords: Cc:
Parent Tickets: Sensitive: no

Description[], byte[]) performs superfluous comparisons, as someone in a comment already suspected:

this appears to be the way Arrays.equals is defined, so all the extra
tests are unnecessary?

boolean eq = (((lhs == null) && (rhs == null))
((lhs != null) &&(rhs != null) && (Arrays.equals(lhs, rhs))));

return eq;

I can confirm that Arrays.equals returns exactly the same results as this expression, so I suggest to replace it by:
return Arrays.equals(lhs, rhs);


Change History (1)

comment:1 Changed 10 years ago by zzz

Resolution: fixed
Status: newclosed

fixed 0.8.4-9

Note: See TracTickets for help on using tickets.