Avoid unnecessary arguments copying inside GenericHashTraits methods

Before the change both WTF::GenericHashTraits::passOut and WTF::GenericHashTraits::passOut
used to return the given argument always by value and that caused implicit extra
copying of the argument. It was OK as long as argument type T was POD, as compiler
could optimize it, but in case T was a class having non-trivial copy constructor the
extra copying of the argument could not have been obviated.

The proposed solution is to provide overloaded functions that accept non-temporary
values and return them by reference thus avoiding extra copying.

Review URL: https://chromiumcodereview.appspot.com/14786023

git-svn-id: svn://svn.chromium.org/blink/trunk@149975 bbb929c8-8fbe-4397-9dbb-9b2b20218538
1 file changed