Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LLVM is not smart enough to eliminate calls to `EcoVec::reserve()` even when they are unecessary thanks to earlier calls to `EcoVec::reserve()` or `EcoVec::with_capacity()`. This patch elimates them when the `ecovec![]` macro is used. There may be other unnecessary calls which can be elimated in future patches. `ecovec![1, 2, 3]` results in 3 unecessary calls to `EcoVec::reserve()`. Fixed by forwarding to the `From<[T; N]>` impl. `ecovec![1; 42]` results in 42 unecessary calls to `EcoVec::reserve()`. Fixed by adding `EcoVec::push_unchecked()` function for when we know resizing is unnecessary.
- Loading branch information