Refactored FormData, FormFieldData comparison operators.
This is a cleanup CL that avoids any semantic changes, with one exception noted below. * Used std::tie() and tuples to improve maintainability in FormFieldData. * Removed FormData::operator==() and FormFieldData::operator==() They were only used in tests, and they are relatively difficult to maintain. (Case in point: FormFieldData::operator==() did not compare several members, and behaved awkwardly for |FormFieldData::label|.) Replaced the usage in the tests with !(a < b) && !(b < a). * Moved FormData::operator<(), FormFieldData::operator<() to comparators. These only exist to make STL containers happy, namely an std::set member of FormCache. The style guide advises not to implement operator<() in such cases. * FormData::operator<() and FormFieldData::operator<() (now the comparators) did and do not compare all members. This seems unintended with the use case in FormCache. However, this change is deferred to a follow-up CL. This CL only makes minor modifications to the lexicographic orderings in that the order in which the members are compared is slightly changed. This should have no repercussions since FormCache makes no assumptions about the ordering. Bug: 1007974 Change-Id: I5109aa37edccfd858993e1f0c6992b9988c8cf46 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1884790Reviewed-by:Vadym Doroshenko <dvadym@chromium.org> Reviewed-by:
Emily Stark <estark@chromium.org> Reviewed-by:
Jan Wilken Dörrie <jdoerrie@chromium.org> Commit-Queue: Christoph Schwering <schwering@google.com> Cr-Commit-Position: refs/heads/master@{#714276}
Showing
This diff is collapsed.
Please register or sign in to comment