Fix LeDevice, ClassicDevice, Device, AdapterConfig less than operators
If a class has two members A and B, and we want to order the class by A
first and then by B:
obj1.A < obj2.A && obj1.B < obj2.B
is the wrong alrogithm. Instead, something like
if (obj1.A != obj1.A) {
return obj1.A < obj2.A;
}
return obj1.B < obj2.B;
should be used.
An incorrectly implemented less than operator will affect std::map's
functionality as std::map thinks that
if (!(obj1 < obj2) && !(obj2 < obj1)) ==> obj1 == obj2
Bug: 242054540
Test: gd/cert/run
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines
Merged-In: Ic9f55d5c776a935c49ca889c46e667bc7b961b4f
Change-Id: Ic9f55d5c776a935c49ca889c46e667bc7b961b4f
Loading
Please register or sign in to comment