From b9ce5953275236d5a71eb44eef4e5edac765d727 Mon Sep 17 00:00:00 2001 From: Frederik Gossen Date: Thu, 19 Dec 2024 16:43:44 -0800 Subject: [PATCH] [Cleanup] Use push_back instead of emplace_back where appropriate (go/totw/112) PiperOrigin-RevId: 708081144 --- xla/hlo/builder/lib/comparators.cc | 4 ++-- xla/hlo/builder/xla_builder.cc | 2 +- xla/hlo/ir/hlo_computation.cc | 2 +- xla/hlo/parser/hlo_parser.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xla/hlo/builder/lib/comparators.cc b/xla/hlo/builder/lib/comparators.cc index fec1874a0373d..a4965caab0d93 100644 --- a/xla/hlo/builder/lib/comparators.cc +++ b/xla/hlo/builder/lib/comparators.cc @@ -74,8 +74,8 @@ XlaComputation CreateScalarComparisonComputation( absl::StrCat("p.", parameter_count, ".lhs")); auto rhs_param = Parameter(b.get(), parameter_count * 2 + 1, scalar_shape, absl::StrCat("p.", parameter_count, ".rhs")); - lhs_params.emplace_back(lhs_param); - rhs_params.emplace_back(rhs_param); + lhs_params.push_back(lhs_param); + rhs_params.push_back(rhs_param); if (generators[parameter_count].has_value()) { last_generator_index = parameter_count; } diff --git a/xla/hlo/builder/xla_builder.cc b/xla/hlo/builder/xla_builder.cc index 65d62ec4237a0..08d65ba9359b2 100644 --- a/xla/hlo/builder/xla_builder.cc +++ b/xla/hlo/builder/xla_builder.cc @@ -3456,7 +3456,7 @@ XlaOp XlaBuilder::ConditionalImpl( std::vector operands(1, branch_index); for (const XlaOp branch_operand : branch_operands) { - operands.emplace_back(branch_operand); + operands.push_back(branch_operand); } return AddInstruction(std::move(instr), HloOpcode::kConditional, absl::MakeSpan(operands)); diff --git a/xla/hlo/ir/hlo_computation.cc b/xla/hlo/ir/hlo_computation.cc index f1420ecc549bb..0cb22c0964e57 100644 --- a/xla/hlo/ir/hlo_computation.cc +++ b/xla/hlo/ir/hlo_computation.cc @@ -1728,7 +1728,7 @@ std::unique_ptr HloComputation::CloneInContext( for (HloInstruction* operand : cur->operands()) { const HloInstruction* new_operand = replace(operand); if (new_operand) { - dfs_stack.emplace_back(new_operand); + dfs_stack.push_back(new_operand); } } } diff --git a/xla/hlo/parser/hlo_parser.cc b/xla/hlo/parser/hlo_parser.cc index 43e4cdca70551..01335cb5ff28d 100644 --- a/xla/hlo/parser/hlo_parser.cc +++ b/xla/hlo/parser/hlo_parser.cc @@ -6629,7 +6629,7 @@ bool HloParserImpl::ParseListShardingType( if (!ParseOpShardingType(&type)) { return false; } - types->emplace_back(type); + types->push_back(type); } while (EatIfPresent(TokKind::kComma)); }