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

Unified Diff: chrome/browser/sync/syncable/syncable_id.cc

Issue 6588119: First-time sync: asymptotic running time improvement (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/Release
Patch Set: Fix unit_tests Created 9 years, 10 months 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: chrome/browser/sync/syncable/syncable_id.cc
diff --git a/chrome/browser/sync/syncable/syncable_id.cc b/chrome/browser/sync/syncable/syncable_id.cc
index 766289b176637a56365bad2536de27b844ea0870..eeefd59581a52588fd0cc8760b0a46ae0f62ba99 100644
--- a/chrome/browser/sync/syncable/syncable_id.cc
+++ b/chrome/browser/sync/syncable/syncable_id.cc
@@ -45,4 +45,19 @@ Id Id::CreateFromClientString(const string& local_id) {
return id;
}
+Id Id::GetLexicographicSuccessor() const {
+ // The successor of a string is given by appending the least
+ // character in the alphabet.
+ Id id = *this;
+ id.s_.push_back(std::numeric_limits<std::string::value_type>::min());
+ return id;
+}
+
+// static
+Id Id::GetLeastIdForLexicographicComparison() {
+ Id id;
+ id.s_.clear();
+ return id;
+}
+
} // namespace syncable
« chrome/browser/sync/syncable/syncable.cc ('K') | « chrome/browser/sync/syncable/syncable_id.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698