-
Notifications
You must be signed in to change notification settings - Fork 150
Some small simplifications #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
benches show nothing out of the ordinary: ``` name smallvecbench.txt ns/iter smallvecbench-new.txt ns/iter diff ns/iter diff % speedup bench_extend 47 47 0 0.00% x 1.00 bench_extend_from_slice 41 41 0 0.00% x 1.00 bench_extend_from_slice_small 12 12 0 0.00% x 1.00 bench_extend_from_slice_vec 55 55 0 0.00% x 1.00 bench_extend_from_slice_vec_small 25 25 0 0.00% x 1.00 bench_extend_small 13 13 0 0.00% x 1.00 bench_extend_vec 66 58 -8 -12.12% x 1.14 bench_extend_vec_small 24 24 0 0.00% x 1.00 bench_from_slice 80 80 0 0.00% x 1.00 bench_from_slice_small 22 23 1 4.55% x 0.96 bench_from_slice_vec 32 30 -2 -6.25% x 1.07 bench_from_slice_vec_small 27 27 0 0.00% x 1.00 bench_insert 618 605 -13 -2.10% x 1.02 bench_insert_from_slice 85 85 0 0.00% x 1.00 bench_insert_many 177 177 0 0.00% x 1.00 bench_insert_small 119 120 1 0.84% x 0.99 bench_insert_vec 541 542 1 0.18% x 1.00 bench_insert_vec_small 123 125 2 1.63% x 0.98 bench_macro_from_elem 35 34 -1 -2.86% x 1.03 bench_macro_from_elem_small 7 7 0 0.00% x 1.00 bench_macro_from_elem_vec 40 34 -6 -15.00% x 1.18 bench_macro_from_elem_vec_small 27 27 0 0.00% x 1.00 bench_macro_from_list 21 22 1 4.76% x 0.95 bench_macro_from_list_vec 20 21 1 5.00% x 0.95 bench_push 388 386 -2 -0.52% x 1.01 bench_push_small 65 66 1 1.54% x 0.98 bench_push_vec 335 338 3 0.90% x 0.99 bench_push_vec_small 44 46 2 4.55% x 0.96 bench_pushpop 746 746 0 0.00% x 1.00 bench_pushpop_vec 247 247 0 0.00% x 1.00 bench_remove 414 411 -3 -0.72% x 1.01 bench_remove_small 89 90 1 1.12% x 0.99 bench_remove_vec 424 406 -18 -4.25% x 1.04 bench_remove_vec_small 80 81 1 1.25% x 0.99 ```
} | ||
} | ||
} | ||
self.iter.next().map(|reference| unsafe { ptr::read(reference) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I would suggest ptr::read(self.iter.next()?)
but this requires Rust 1.22, and it's not raising the minimum Rust version for this crate yet.
@bors-servo r+ |
📌 Commit 4d02e41 has been approved by |
Some small simplifications benches show nothing out of the ordinary: ``` name smallvecbench.txt ns/iter smallvecbench-new.txt ns/iter diff ns/iter diff % speedup bench_extend 47 47 0 0.00% x 1.00 bench_extend_from_slice 41 41 0 0.00% x 1.00 bench_extend_from_slice_small 12 12 0 0.00% x 1.00 bench_extend_from_slice_vec 55 55 0 0.00% x 1.00 bench_extend_from_slice_vec_small 25 25 0 0.00% x 1.00 bench_extend_small 13 13 0 0.00% x 1.00 bench_extend_vec 66 58 -8 -12.12% x 1.14 bench_extend_vec_small 24 24 0 0.00% x 1.00 bench_from_slice 80 80 0 0.00% x 1.00 bench_from_slice_small 22 23 1 4.55% x 0.96 bench_from_slice_vec 32 30 -2 -6.25% x 1.07 bench_from_slice_vec_small 27 27 0 0.00% x 1.00 bench_insert 618 605 -13 -2.10% x 1.02 bench_insert_from_slice 85 85 0 0.00% x 1.00 bench_insert_many 177 177 0 0.00% x 1.00 bench_insert_small 119 120 1 0.84% x 0.99 bench_insert_vec 541 542 1 0.18% x 1.00 bench_insert_vec_small 123 125 2 1.63% x 0.98 bench_macro_from_elem 35 34 -1 -2.86% x 1.03 bench_macro_from_elem_small 7 7 0 0.00% x 1.00 bench_macro_from_elem_vec 40 34 -6 -15.00% x 1.18 bench_macro_from_elem_vec_small 27 27 0 0.00% x 1.00 bench_macro_from_list 21 22 1 4.76% x 0.95 bench_macro_from_list_vec 20 21 1 5.00% x 0.95 bench_push 388 386 -2 -0.52% x 1.01 bench_push_small 65 66 1 1.54% x 0.98 bench_push_vec 335 338 3 0.90% x 0.99 bench_push_vec_small 44 46 2 4.55% x 0.96 bench_pushpop 746 746 0 0.00% x 1.00 bench_pushpop_vec 247 247 0 0.00% x 1.00 bench_remove 414 411 -3 -0.72% x 1.01 bench_remove_small 89 90 1 1.12% x 0.99 bench_remove_vec 424 406 -18 -4.25% x 1.04 bench_remove_vec_small 80 81 1 1.25% x 0.99 ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/113) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
Version 0.6.5 Change log: * #115 - add `into_inner` method * #117 - add `from_buf_and_len` and `from_buf_and_len_unchecked` * #118 - optimize `from_slice` * Some code cleanup and testing improvements (#112, #113, #114, #120) cc @llogiq <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/121) <!-- Reviewable:end -->
benches show nothing out of the ordinary:
This change is