Chromium Code Reviews| 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() { |