Skip to content

Commit 6a3a869

Browse files
XLS Teamcopybara-github
XLS Team
authored andcommitted
Automated Code Change
PiperOrigin-RevId: 739037116
1 parent 439d40d commit 6a3a869

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

xls/public/c_api_ir_builder.cc

+3
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ struct xls_bvalue* xls_builder_base_add_concat(struct xls_builder_base* builder,
274274
const char* name) {
275275
auto* cpp_builder = reinterpret_cast<xls::BuilderBase*>(builder);
276276
std::vector<xls::BValue> cpp_operands;
277+
cpp_operands.reserve(operand_count);
277278
for (int64_t i = 0; i < operand_count; ++i) {
278279
cpp_operands.push_back(*reinterpret_cast<xls::BValue*>(operands[i]));
279280
}
@@ -337,6 +338,7 @@ struct xls_bvalue* xls_builder_base_add_one_hot_select(
337338
auto* cpp_builder = reinterpret_cast<xls::BuilderBase*>(builder);
338339
auto* cpp_selector = reinterpret_cast<xls::BValue*>(selector);
339340
std::vector<xls::BValue> cpp_cases;
341+
cpp_cases.reserve(case_count);
340342
for (int64_t i = 0; i < case_count; ++i) {
341343
cpp_cases.push_back(*reinterpret_cast<xls::BValue*>(cases[i]));
342344
}
@@ -355,6 +357,7 @@ struct xls_bvalue* xls_builder_base_add_priority_select(
355357
auto* cpp_selector = reinterpret_cast<xls::BValue*>(selector);
356358
auto* cpp_default_value = reinterpret_cast<xls::BValue*>(default_value);
357359
std::vector<xls::BValue> cpp_cases;
360+
cpp_cases.reserve(case_count);
358361
for (int64_t i = 0; i < case_count; ++i) {
359362
cpp_cases.push_back(*reinterpret_cast<xls::BValue*>(cases[i]));
360363
}

0 commit comments

Comments
 (0)