Skip to content

Instantly share code, notes, and snippets.

@kunigami
Last active April 12, 2019 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunigami/4651c28024026f4738ac5081bca3796d to your computer and use it in GitHub Desktop.
Save kunigami/4651c28024026f4738ac5081bca3796d to your computer and use it in GitHub Desktop.
let mut closest_key: u32 = std::u32::MAX;
self.containers.get_with_visitor(
&target_key,
|node_key| {
if (
distance(closest_key, target_key) >
distance(*node_key, target_key) &&
*node_key > target_key
) {
closest_key = *node_key;
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment