mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 08:39:34 +08:00
修正警告: moving a local object in a return statement prevents copy elision
https://www.viva64.com/en/w/v828/ 编译器会对返回本地变量优化([Named] Return Value Optimization (RVO/NRVO)), 无论是 C++11 之前还是之后, 添加 move 后反而会影响该优化. C++ Core Guidelines F.48: Do not return std::move(local)
This commit is contained in:
parent
f903ffeb4a
commit
a024c51536
@ -63,9 +63,9 @@ string HlsMakerImp::onOpenSegment(int index) {
|
||||
WarnL << "create file failed," << segment_path << " " << get_uv_errmsg();
|
||||
}
|
||||
if (_params.empty()) {
|
||||
return std::move(segment_name);
|
||||
return segment_name;
|
||||
}
|
||||
return std::move(segment_name + "?" + _params);
|
||||
return segment_name + "?" + _params;
|
||||
}
|
||||
|
||||
void HlsMakerImp::onDelSegment(int index) {
|
||||
|
Loading…
Reference in New Issue
Block a user