Skip to content

Commit

Permalink
Bug 1212745 - Part 1 - operator() Use perfect forwarding to avoid red…
Browse files Browse the repository at this point in the history
…undant copy. r=nfroyd
  • Loading branch information
JamesWCCheng committed Oct 8, 2015
1 parent bf740b7 commit 23b7d3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mfbt/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ class Function<ReturnType(Arguments...)>
return *this;
}

ReturnType operator()(Arguments... aArguments) const
template<typename... Args>
ReturnType operator()(Args&&... aArguments) const
{
MOZ_ASSERT(mImpl);
return mImpl->call(Forward<Arguments>(aArguments)...);
return mImpl->call(Forward<Args>(aArguments)...);
}
private:
// TODO: Consider implementing a small object optimization.
Expand Down

0 comments on commit 23b7d3d

Please sign in to comment.