From 5e032ffed0227f9e9b3029333d4b1cf67b90070d Mon Sep 17 00:00:00 2001 From: James Cheng Date: Thu, 8 Oct 2015 11:38:00 +0200 Subject: [PATCH] Bug 1212745 - Part 1 - operator() Use perfect forwarding to avoid redundant copy. r=nfroyd --- mfbt/Function.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mfbt/Function.h b/mfbt/Function.h index 13d782f725a..1cc3a5622d6 100644 --- a/mfbt/Function.h +++ b/mfbt/Function.h @@ -155,10 +155,11 @@ public: return *this; } - ReturnType operator()(Arguments... aArguments) const + template + ReturnType operator()(Args&&... aArguments) const { MOZ_ASSERT(mImpl); - return mImpl->call(Forward(aArguments)...); + return mImpl->call(Forward(aArguments)...); } private: // TODO: Consider implementing a small object optimization.