Fix clang-tidy modernize-use-emplace warnings in headers

This commit is contained in:
Tim Wojtulewicz 2025-06-10 09:57:10 -07:00
parent fb55c8856e
commit cb78d2202f
4 changed files with 5 additions and 7 deletions

View file

@ -292,7 +292,7 @@ public:
// Adds to the trace an update for the given value.
void AddDelta(ValPtr val, std::string rhs, bool needs_lhs, bool is_first_def) {
auto& d = is_post ? post_deltas : deltas;
d.emplace_back(DeltaGen(val, rhs, needs_lhs, is_first_def));
d.emplace_back(val, rhs, needs_lhs, is_first_def);
}
// Initially we analyze events pre-execution. When this flag

View file

@ -165,12 +165,10 @@ public:
// stack of location so that the most recent is always the one that
// will be assumed to be the current one. The pointer must remain
// valid until the location is popped.
void PushLocation(const detail::Location* location) {
locations.push_back(std::pair<const detail::Location*, const detail::Location*>(location, 0));
}
void PushLocation(const detail::Location* location) { locations.emplace_back(location, nullptr); }
void PushLocation(const detail::Location* loc1, const detail::Location* loc2) {
locations.push_back(std::pair<const detail::Location*, const detail::Location*>(loc1, loc2));
locations.emplace_back(loc1, loc2);
}
// Removes the top-most location information from stack.

View file

@ -88,7 +88,7 @@ eval EvalIndexAnyVec($$, $1, $2)
macro WhenIndexResCheck(vec)
if ( vec && IndexExprWhen::evaluating > 0 )
IndexExprWhen::results.push_back({NewRef{}, vec});
IndexExprWhen::results.emplace_back(NewRef{}, vec);
internal-op When-Index-Vec
class VVV

View file

@ -95,7 +95,7 @@ eval auto vv = $1.AsVector();
vv->Assign(0, $2.ToVal(Z_TYPE));
else
{
vv->RawVec().push_back(CopyVal($2));
vv->RawVec().emplace_back(CopyVal($2));
vv->Modified();
}