summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cb1709e)
Locals left and right shadow two same named
variables in the std::ifstream base class.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
void Book::binary_search(uint64_t key) {
void Book::binary_search(uint64_t key) {
- size_t left, right, mid;
- left = 0;
- right = size - 1;
+ low = 0;
+ high = size - 1;
- while (left < right && good())
+ while (low < high && good())
- mid = (left + right) / 2;
+ mid = (low + high) / 2;
- assert(mid >= left && mid < right);
+ assert(mid >= low && mid < high);
seekg(mid * sizeof(BookEntry), ios_base::beg);
*this >> e;
if (key <= e.key)
seekg(mid * sizeof(BookEntry), ios_base::beg);
*this >> e;
if (key <= e.key)
- seekg(left * sizeof(BookEntry), ios_base::beg);
+ seekg(low * sizeof(BookEntry), ios_base::beg);