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

Side by Side 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 test bug. Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/syncable/syncable_id.h" 5 #include "chrome/browser/sync/syncable/syncable_id.h"
6 6
7 #include <iosfwd> 7 #include <iosfwd>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 10
(...skipping 27 matching lines...) Expand all
38 38
39 Id Id::CreateFromClientString(const string& local_id) { 39 Id Id::CreateFromClientString(const string& local_id) {
40 Id id; 40 Id id;
41 if (local_id == "0") 41 if (local_id == "0")
42 id.s_ = "r"; 42 id.s_ = "r";
43 else 43 else
44 id.s_ = string("c") + local_id; 44 id.s_ = string("c") + local_id;
45 return id; 45 return id;
46 } 46 }
47 47
48 Id Id::GetLexicographicSuccessor() const {
49 // The successor of a string is given by appending the least
50 // character in the alphabet.
51 Id id = *this;
52 id.s_.push_back(0);
53 return id;
54 }
55
56 // static
57 Id Id::GetLeastIdForLexicographicComparison() {
58 Id id;
59 id.s_.clear();
60 return id;
61 }
62
48 } // namespace syncable 63 } // namespace syncable
OLDNEW
« no previous file with comments | « chrome/browser/sync/syncable/syncable_id.h ('k') | chrome/browser/sync/syncable/syncable_id_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698