Commit 343b4c3
committed
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).1 parent 7ba7622 commit 343b4c3
File tree
2 files changed
+37
-4
lines changed- src
- libcollectionstest
- libcollections
2 files changed
+37
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
813 | | - | |
| 813 | + | |
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| |||
1916 | 1916 | | |
1917 | 1917 | | |
1918 | 1918 | | |
1919 | | - | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
1920 | 1924 | | |
1921 | 1925 | | |
1922 | 1926 | | |
| |||
1980 | 1984 | | |
1981 | 1985 | | |
1982 | 1986 | | |
1983 | | - | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
1984 | 1992 | | |
1985 | 1993 | | |
1986 | 1994 | | |
| |||
2017 | 2025 | | |
2018 | 2026 | | |
2019 | 2027 | | |
2020 | | - | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
2021 | 2033 | | |
2022 | 2034 | | |
2023 | 2035 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
0 commit comments