]> git.lizzy.rs Git - rust.git/commit
Minor optimization for `VecMap::split_off`
authorJohannes Oertel <johannes.oertel@uni-due.de>
Mon, 11 May 2015 10:54:59 +0000 (12:54 +0200)
committerJohannes Oertel <johannes.oertel@uni-due.de>
Mon, 11 May 2015 10:54:59 +0000 (12:54 +0200)
commit5b0e19794efe6d2d7f225df57505205627103f32
tree6e473c7b378b14ec770f098b20e7070d16ef5225
parentc44d84da981c14cdaa144aa7b0f1109578ed72c3
Minor optimization for `VecMap::split_off`

We don't need to copy any elements if `at` is behind the last element
in the map. The last element is at index `self.v.len() - 1`, so we
should not copy if `at` is greater or equals `self.v.len()`.
src/libcollections/vec_map.rs