Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2335d8d

Browse files
committed
use vector::push_back for simple types
1 parent b0828d7 commit 2335d8d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

display_list/display_list.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static std::vector<size_t> MakeOffsets(const DisplayListStorage& storage,
3838
const uint8_t* end = start + byte_count;
3939
const uint8_t* ptr = start;
4040
while (ptr < end) {
41-
offsets.emplace_back(ptr - start);
41+
offsets.push_back(ptr - start);
4242
ptr += reinterpret_cast<const DLOp*>(ptr)->size;
4343
}
4444
return offsets;
@@ -124,7 +124,7 @@ void DisplayList::RTreeResultsToIndexVector(
124124
// then gets reset to the value stored in the stack top
125125
if (info.save_was_needed) {
126126
FML_DCHECK(next_restore_index < offsets_.size());
127-
indices.emplace_back(next_restore_index);
127+
indices.push_back(next_restore_index);
128128
}
129129
next_restore_index = info.previous_restore_index;
130130
save_infos.pop_back();
@@ -137,20 +137,20 @@ void DisplayList::RTreeResultsToIndexVector(
137137
switch (GetOpCategory(op->type)) {
138138
case DisplayListOpCategory::kAttribute:
139139
// Attributes are always needed
140-
indices.emplace_back(index);
140+
indices.push_back(index);
141141
break;
142142

143143
case DisplayListOpCategory::kTransform:
144144
case DisplayListOpCategory::kClip:
145145
if (next_render_index < next_restore_index) {
146-
indices.emplace_back(index);
146+
indices.push_back(index);
147147
}
148148
break;
149149

150150
case DisplayListOpCategory::kRendering:
151151
case DisplayListOpCategory::kSubDisplayList:
152152
if (index == next_render_index) {
153-
indices.emplace_back(index);
153+
indices.push_back(index);
154154
}
155155
break;
156156

@@ -169,7 +169,7 @@ void DisplayList::RTreeResultsToIndexVector(
169169
FML_UNREACHABLE();
170170
}
171171
if (needed) {
172-
indices.emplace_back(index);
172+
indices.push_back(index);
173173
}
174174
break;
175175
}
@@ -180,7 +180,7 @@ void DisplayList::RTreeResultsToIndexVector(
180180
SaveInfo& info = save_infos.back();
181181
next_restore_index = info.previous_restore_index;
182182
if (info.save_was_needed) {
183-
indices.emplace_back(index);
183+
indices.push_back(index);
184184
}
185185
save_infos.pop_back();
186186
break;
@@ -383,7 +383,7 @@ DisplayListOpType DisplayList::GetOpType(DlIndex index) const {
383383
static void FillAllIndices(std::vector<DlIndex>& indices, DlIndex size) {
384384
indices.reserve(size);
385385
for (DlIndex i = 0u; i < size; i++) {
386-
indices.emplace_back(i);
386+
indices.push_back(i);
387387
}
388388
}
389389

0 commit comments

Comments
 (0)