Remove unneccessary test for &that==this in folly::Function's move assignment operator.
authorEric Niebler <eniebler@fb.com>
Thu, 30 Mar 2017 21:09:34 +0000 (14:09 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 30 Mar 2017 21:18:19 +0000 (14:18 -0700)
commit382b70adaa6fbce5ab568fc23a825483ed9df93f
treefcf1b937caee22705e4c6545bf3be858107142c9
parent72ea700cfbbe54c1a3f30d7c9e61a2af9b8a7a1a
Remove unneccessary test for &that==this in folly::Function's move assignment operator.

Summary: Self-moves are exceedingly rare and need not preserve the state of the object. They must only leave the object in a valid but unspecified state. By removing the branch, we make the common case (non-self move) faster.

Reviewed By: spacedentist, ot

Differential Revision: D4803486

fbshipit-source-id: 3ef2e1e13cd08d9221ecb154bfb3338b16487717
folly/Function.h
folly/test/FunctionTest.cpp