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

Unified Diff: sync/internal_api/public/base/ordinal.h

Issue 10989063: Changed DB to store node positions as Ordinals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Changed server_position to server_ordinal in DB Created 8 years, 2 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: sync/internal_api/public/base/ordinal.h
diff --git a/sync/internal_api/public/base/ordinal.h b/sync/internal_api/public/base/ordinal.h
index 91897599e782efda44c6854ee11bfbe31dabf3da..aa6ffa91fcf92b96015fc369e8a45bbef56dcb0b 100644
--- a/sync/internal_api/public/base/ordinal.h
+++ b/sync/internal_api/public/base/ordinal.h
@@ -78,7 +78,7 @@ class Ordinal {
// may be valid or invalid.
explicit Ordinal(const std::string& bytes);
- // Creates an invalid Ordinal.
+ // Creates a valid initial Ordinal.
akalin 2012/10/05 00:57:59 hmm why is this necessary? Why not CreateInitialO
vishwath 2012/10/05 18:34:49 There are multiple places where new entry kernels
rlarocque 2012/10/05 19:02:55 I think the trend is to initialize those values in
vishwath 2012/10/05 21:05:48 Entrykernels are also created in directory_backing
akalin 2012/10/05 21:20:15 Yeah. Ideally, EntryKernels would have to be cons
rlarocque 2012/10/05 21:29:34 I think I agree, but I just want to clarify. Entr
Ordinal();
// Creates a valid initial Ordinal. This is called to create the first
@@ -232,7 +232,11 @@ Ordinal<Traits>::Ordinal(const std::string& bytes)
is_valid_(IsValidOrdinalBytes(bytes_)) {}
template <typename Traits>
-Ordinal<Traits>::Ordinal() : is_valid_(false) {}
+Ordinal<Traits>::Ordinal()
+ : bytes_(Traits::kMinLength, kZeroDigit),
+ is_valid_(true){
+ bytes_[0] = kMidDigit;
+}
template <typename Traits>
Ordinal<Traits> Ordinal<Traits>::CreateInitialOrdinal() {

Powered by Google App Engine
This is Rietveld 408576698