Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 344e8c07 authored by Patrick Rohr's avatar Patrick Rohr
Browse files

Do not use hash code for LinkAddress comparison

CompareOrUpdateResult cannot use hash code because the key function must
return a unique result for every object.

The previous iteration of this code performed an equals comparison on a
hash code int rather than the individual elements themselves. This can
lead to hash code collisions for LinkAddresses which are otherwise
unrelated (i.e. not equal).

For example, if there is a collision in the collection of oldItems,
CompareOrUpdateResult will collapse the items into one (by overriding
all previous items with the same hash code) which affects the subsequent
comparison with newItems.

Test: TH
Flag: EXEMPT trivial bug fix
Change-Id: I8778bf48e3b550dbeaa75ee8b5b3b3178b874741
parent 413fb45b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment