Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-format] Use std::iota and reserve. NFC.
This way we have at most 1 allocation even if the number of includes is greater than the on-stack size of the small vector.
- Loading branch information
e75a342
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.
A cleaner way of writing this with LLVM utilities would be something like
llvm::to_vector<16>(llvm::seq<unsigned>(0, Includes.size()))
e75a342
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.
Ok, I didn't know about
llvm::seq
. Thanks!