Faster accessors for dynamic values
[folly.git] / folly / ThreadCachedInt.h
index 6a6a694809f4efad2ec2efb6de32d78f484bec7a..d573ed656723d5ef0bc8fb1b2a1aab22b4cdbc2c 100644 (file)
@@ -27,8 +27,8 @@
 
 #include <boost/noncopyable.hpp>
 
-#include "folly/Likely.h"
-#include "folly/ThreadLocal.h"
+#include <folly/Likely.h>
+#include <folly/ThreadLocal.h>
 
 namespace folly {
 
@@ -48,7 +48,7 @@ class ThreadCachedInt : boost::noncopyable {
 
   void increment(IntT inc) {
     auto cache = cache_.get();
-    if (UNLIKELY(cache == NULL || cache->parent_ == NULL)) {
+    if (UNLIKELY(cache == nullptr || cache->parent_ == nullptr)) {
       cache = new IntCache(*this);
       cache_.reset(cache);
     }
@@ -122,7 +122,7 @@ class ThreadCachedInt : boost::noncopyable {
   // need to make sure we signal that this parent is dead.
   ~ThreadCachedInt() {
     for (auto& cache : cache_.accessAllThreads()) {
-      cache.parent_ = NULL;
+      cache.parent_ = nullptr;
     }
   }