about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2013-05-31 18:48:06 -0700
committerKevin Ballard <kevin@sb.org>2013-06-01 17:37:57 -0700
commit7bc950c43c820b0a0cfeede7dcf2d719625dbd90 (patch)
tree0b3ad1ed07d3a78a7342ae6886b3d59b5a0eade9 /src/rt/rust_kernel.cpp
parent44af5064d0ac3d45223f1555b299f10fd4902f5c (diff)
downloadrust-7bc950c43c820b0a0cfeede7dcf2d719625dbd90.tar.gz
rust-7bc950c43c820b0a0cfeede7dcf2d719625dbd90.zip
Refactor some hashmap code into a new private function mangle()
Add new private hashmap function

    fn mangle(&mut self,
              k: K,
              not_found: &fn(&K) -> V,
              found: &fn(&K, &mut V)) -> uint

Rewrite find_or_insert() and find_or_insert_with() on top of mangle().

Also take the opportunity to change the return type of find_or_insert()
and find_or_insert_with() to &'a mut V. This fixes #6394.
Diffstat (limited to 'src/rt/rust_kernel.cpp')
0 files changed, 0 insertions, 0 deletions