Avoid copying local variables if possible

This commit is contained in:
Yonas Habteab 2022-08-26 16:53:56 +02:00
parent 4d46d73f41
commit 08cca705a8
2 changed files with 3 additions and 3 deletions

View File

@ -171,7 +171,7 @@ std::pair<double, double> ScheduledDowntime::FindRunningSegment(double minEnd)
if (!bestSegment || end > bestEnd) {
Log(LogDebug, "ScheduledDowntime") << "(best match yet)";
bestSegment = segment;
bestSegment = std::move(segment);
bestBegin = begin;
bestEnd = end;
}
@ -227,7 +227,7 @@ std::pair<double, double> ScheduledDowntime::FindNextSegment()
if (!bestSegment || begin < bestBegin) {
Log(LogDebug, "ScheduledDowntime") << "(best match yet)";
bestSegment = segment;
bestSegment = std::move(segment);
bestBegin = begin;
bestEnd = end;
}

View File

@ -33,7 +33,7 @@ void HttpHandler::Register(const Url::Ptr& url, const HttpHandler::Ptr& handler)
children->Set(elem, sub_node);
}
node = sub_node;
node = std::move(sub_node);
}
Array::Ptr handlers = node->Get("handlers");