execute callbacks as rvalue references
[folly.git] / folly / futures / ThreadWheelTimekeeper.cpp
index 37ddf08daf0fdfd8491f38fa44e4ab783c022726..eb1151f2e403fdf5ccf52eef39af4d96c000d9c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -84,11 +84,10 @@ struct WTCallback : public std::enable_shared_from_this<WTCallback>,
 
 } // namespace
 
-
-ThreadWheelTimekeeper::ThreadWheelTimekeeper() :
-  thread_([this]{ eventBase_.loopForever(); }),
-  wheelTimer_(new HHWheelTimer(&eventBase_, std::chrono::milliseconds(1)))
-{
+ThreadWheelTimekeeper::ThreadWheelTimekeeper()
+    : thread_([this] { eventBase_.loopForever(); }),
+      wheelTimer_(
+          HHWheelTimer::newTimer(&eventBase_, std::chrono::milliseconds(1))) {
   eventBase_.waitUntilRunning();
   eventBase_.runInEventBaseThread([this]{
     // 15 characters max