]> git.lizzy.rs Git - rust.git/commit
collections: Simplify VecDeque::is_empty
authorUlrik Sverdrup <bluss@users.noreply.github.com>
Sat, 3 Dec 2016 21:11:06 +0000 (22:11 +0100)
committerUlrik Sverdrup <bluss@users.noreply.github.com>
Sun, 4 Dec 2016 14:46:36 +0000 (15:46 +0100)
commit343b4c321d9ab0e1efc7953a15ee0dbc62c722a9
treeab3ce820fb0891387c2dc224ce440cb26764f429
parent7ba762253ccf487ae61b2be45a9edfdf19b79cc0
collections: Simplify VecDeque::is_empty

Improve is_empty on the VecDeque and its iterators by just comparing
tail and head; this saves a few instructions (to be able to remove the
`& (size - 1)` computation, it would have to know that size is a power of two).
src/libcollections/vec_deque.rs
src/libcollectionstest/vec_deque.rs