forked from OSchip/llvm-project
[clang-format] Hoist vector allocation out of loop. NFC.
llvm-svn: 239604
This commit is contained in:
parent
0b9319edb0
commit
3aa55db86d
|
@ -203,11 +203,14 @@ void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) {
|
|||
|
||||
// We can never place more than ColumnLimit / 3 items in a row (because of the
|
||||
// spaces and the comma).
|
||||
for (unsigned Columns = 1; Columns <= Style.ColumnLimit / 3; ++Columns) {
|
||||
unsigned MaxItems = Style.ColumnLimit / 3;
|
||||
std::vector<unsigned> MinSizeInColumn;
|
||||
MinSizeInColumn.reserve(MaxItems);
|
||||
for (unsigned Columns = 1; Columns <= MaxItems; ++Columns) {
|
||||
ColumnFormat Format;
|
||||
Format.Columns = Columns;
|
||||
Format.ColumnSizes.resize(Columns);
|
||||
std::vector<unsigned> MinSizeInColumn(Columns, UINT_MAX);
|
||||
MinSizeInColumn.assign(Columns, UINT_MAX);
|
||||
Format.LineCount = 1;
|
||||
bool HasRowWithSufficientColumns = false;
|
||||
unsigned Column = 0;
|
||||
|
|
Loading…
Reference in New Issue