[PATCH] D115064: [clang-format][NFC] Replace deque with vector

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 4 12:15:02 PST 2021


HazardyKnusperkeks added a comment.

In D115064#3170615 <https://reviews.llvm.org/D115064#3170615>, @curdeius wrote:

> Deque, contrary to the vector, doesn't need to move the elements when growing. I'm not sure if that's relevant here though.
> Have you checked what's on average the maximum size of `Path` on some larger repo?
> Maybe using `llvm::SmallVector` with some well-thought (data-based) static number of elements would be better here, WDYT?

I have not checked what the sizes are. But I have thought about reserving the upper bound (all visited states) so there is only one allocation.
The moving of the content shouldn't be problematic, since we only have pointers.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115064/new/

https://reviews.llvm.org/D115064



More information about the cfe-commits mailing list