Skip to content

Commit

Permalink
fix a bug in binary search
Browse files Browse the repository at this point in the history
  • Loading branch information
dfyz committed Feb 9, 2017
1 parent 08979f2 commit c3e07df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/geodata/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ impl<'a> Tags<'a> {
Ordering::Equal => return Some(mid_value.get_value().unwrap()),
}
}
None
let final_candidate = self.reader.get(lo);
if final_candidate.get_key().unwrap() == key {
Some(final_candidate.get_value().unwrap())
} else {
None
}
}

pub fn get(&self, index: u32) -> geodata_capnp::tag::Reader<'a> {
Expand Down

0 comments on commit c3e07df

Please sign in to comment.