提交 e00b4d6c 创建 作者: Austin Clements's avatar Austin Clements

radix: Make radix_iterator fields private

上级 73eaacd0
...@@ -225,15 +225,6 @@ struct radix { ...@@ -225,15 +225,6 @@ struct radix {
}; };
struct radix_iterator { struct radix_iterator {
const radix* r_;
u64 k_;
// The key value just past the end of the range being iterator over.
u64 key_limit_;
// path_[i] points into the child array of the node at level i.
const radix_ptr *path_[radix_levels];
// The level of the current element.
u32 level_;
radix_iterator(const radix* r, u64 k, u64 limit) radix_iterator(const radix* r, u64 k, u64 limit)
: r_(r), k_(k), key_limit_(limit) : r_(r), k_(k), key_limit_(limit)
{ {
...@@ -257,6 +248,15 @@ struct radix_iterator { ...@@ -257,6 +248,15 @@ struct radix_iterator {
return r_ != other.r_ || k_ != other.k_; } return r_ != other.r_ || k_ != other.k_; }
private: private:
const radix* r_;
u64 k_;
// The key value just past the end of the range being iterator over.
u64 key_limit_;
// path_[i] points into the child array of the node at level i.
const radix_ptr *path_[radix_levels];
// The level of the current element.
u32 level_;
// Prepare the initial path_ and level_ based on k_. // Prepare the initial path_ and level_ based on k_.
void prime_path(); void prime_path();
// Advance to the next non-null leaf. This assumes that // Advance to the next non-null leaf. This assumes that
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论