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

Unified Diff: storage/browser/quota/quota_database.cc

Issue 1455403004: Use std::tie() for operator< in storage/ (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/quota/quota_database.cc
diff --git a/storage/browser/quota/quota_database.cc b/storage/browser/quota/quota_database.cc
index 36632c69eab7c8f2f9a903d9510d364b5ccf5f9e..3a28f0213deb2bb67c9f582fb4d95278b9a4bf44 100644
--- a/storage/browser/quota/quota_database.cc
+++ b/storage/browser/quota/quota_database.cc
@@ -4,6 +4,7 @@
#include "storage/browser/quota/quota_database.h"
+#include <tuple>
#include <vector>
#include "base/auto_reset.h"
@@ -793,22 +794,14 @@ bool QuotaDatabase::DumpOriginInfoTable(
bool operator<(const QuotaDatabase::QuotaTableEntry& lhs,
const QuotaDatabase::QuotaTableEntry& rhs) {
- if (lhs.host < rhs.host) return true;
- if (rhs.host < lhs.host) return false;
- if (lhs.type < rhs.type) return true;
- if (rhs.type < lhs.type) return false;
- return lhs.quota < rhs.quota;
+ return std::tie(lhs.host, lhs.type, lhs.quota) <
+ std::tie(rhs.host, rhs.type, rhs.quota);
}
bool operator<(const QuotaDatabase::OriginInfoTableEntry& lhs,
const QuotaDatabase::OriginInfoTableEntry& rhs) {
- if (lhs.origin < rhs.origin) return true;
- if (rhs.origin < lhs.origin) return false;
- if (lhs.type < rhs.type) return true;
- if (rhs.type < lhs.type) return false;
- if (lhs.used_count < rhs.used_count) return true;
- if (rhs.used_count < lhs.used_count) return false;
- return lhs.last_access_time < rhs.last_access_time;
+ return std::tie(lhs.origin, lhs.type, lhs.used_count, lhs.last_access_time) <
+ std::tie(rhs.origin, rhs.type, rhs.used_count, rhs.last_access_time);
}
} // namespace storage
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698