Skip to content

Commit

Permalink
fix: remove redundant std::move for a local object in a return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyncs authored and chenshuo committed Dec 2, 2019
1 parent 0edc4c9 commit 0f3cb97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion muduo/base/BlockingQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BlockingQueue : noncopyable
assert(!queue_.empty());
T front(std::move(queue_.front()));
queue_.pop_front();
return std::move(front);
return front;
}

size_t size() const
Expand Down
2 changes: 1 addition & 1 deletion muduo/base/BoundedBlockingQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class BoundedBlockingQueue : noncopyable
T front(std::move(queue_.front()));
queue_.pop_front();
notFull_.notify();
return std::move(front);
return front;
}

bool empty() const
Expand Down

0 comments on commit 0f3cb97

Please sign in to comment.