mirror of
https://github.com/MaskRay/ccls.git
synced 2025-06-07 16:54:54 +00:00
Avoid pessimizing moves in threaded_queue.hh
Clang produces warnings during compilation: ccls/src/threaded_queue.hh:150:27: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move] ccls/src/threaded_queue.hh:150:27: note: remove ‘std::move’ call This patch fixes the issue.
This commit is contained in:
parent
d3808de26a
commit
b2842b20cf
@ -147,7 +147,7 @@ public:
|
|||||||
auto val = std::move(q->front());
|
auto val = std::move(q->front());
|
||||||
q->pop_front();
|
q->pop_front();
|
||||||
--total_count_;
|
--total_count_;
|
||||||
return std::move(val);
|
return val;
|
||||||
};
|
};
|
||||||
if (!priority_.empty())
|
if (!priority_.empty())
|
||||||
return execute(&priority_);
|
return execute(&priority_);
|
||||||
@ -162,7 +162,7 @@ public:
|
|||||||
auto val = std::move(q->front());
|
auto val = std::move(q->front());
|
||||||
q->pop_front();
|
q->pop_front();
|
||||||
--total_count_;
|
--total_count_;
|
||||||
return std::move(val);
|
return val;
|
||||||
};
|
};
|
||||||
if (priority_.size())
|
if (priority_.size())
|
||||||
return execute(&priority_);
|
return execute(&priority_);
|
||||||
|
Loading…
Reference in New Issue
Block a user