(Wangle) Don't use std::bind in Core
authorHannes Roth <hannesr@fb.com>
Tue, 2 Jun 2015 17:09:46 +0000 (10:09 -0700)
committerNoam Lerner <noamler@fb.com>
Wed, 3 Jun 2015 16:54:39 +0000 (09:54 -0700)
Summary:
Seems like an unnecessary indirection that might make it harder to for
the compiler to inline everything (if that's even possible with
`std::bind`)?

Test Plan: Run all the tests.

Reviewed By: hans@fb.com

Subscribers: folly-diffs@, jsedgwick, yfeldblum, chalfant

FB internal diff: D2115032

Signature: t1:2115032:1433182233:3938d0498cad50df32c8b6ee4536de14ae5fd006

folly/futures/detail/Core.h

index 708d28a606130f73644e3de772a4805a6f5f6f05..34d0a725d9479a5ae3fdc800e585fbd4fb58eafa 100644 (file)
@@ -271,8 +271,7 @@ class Core {
     FSM_START(fsm_)
       case State::Armed:
         if (active_) {
-          FSM_UPDATE2(fsm_, State::Done, []{},
-                                         std::bind(&Core::doCallback, this));
+          FSM_UPDATE2(fsm_, State::Done, []{}, [this]{ this->doCallback(); });
         }
         FSM_BREAK