Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2150)

Unified Diff: components/autofill/core/common/form_data.cc

Issue 1447153002: Use std::tie() for operator< in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/common/form_data.cc
diff --git a/components/autofill/core/common/form_data.cc b/components/autofill/core/common/form_data.cc
index aaa8178f48ddb83291b674dbbf48bd464a2aabd3..3d68639b65e3f2b471cffa751ea09cc74a128179 100644
--- a/components/autofill/core/common/form_data.cc
+++ b/components/autofill/core/common/form_data.cc
@@ -4,6 +4,8 @@
#include "components/autofill/core/common/form_data.h"
+#include <tuple>
+
#include "base/base64.h"
#include "base/pickle.h"
#include "base/strings/string_util.h"
@@ -86,15 +88,9 @@ bool FormData::SameFormAs(const FormData& form) const {
}
bool FormData::operator<(const FormData& form) const {
- if (name != form.name)
- return name < form.name;
- if (origin != form.origin)
- return origin < form.origin;
- if (action != form.action)
- return action < form.action;
- if (is_form_tag != form.is_form_tag)
- return is_form_tag < form.is_form_tag;
- return fields < form.fields;
+ return std::tie(name, origin, action, is_form_tag, fields) <
+ std::tie(form.name, form.origin, form.action, form.is_form_tag,
+ form.fields);
}
std::ostream& operator<<(std::ostream& os, const FormData& form) {

Powered by Google App Engine
This is Rietveld 408576698