Draft prototype of hazard pointers C++ template library
[folly.git] / folly / Padded.h
index 94fc1103b43026e5b8ec256ff2f714c209d5f492..aa2ddd369de44133c34dc811021c02164dd0a94b 100644 (file)
@@ -14,8 +14,7 @@
  * limitations under the License.
  */
 
-#ifndef FOLLY_PADDED_H_
-#define FOLLY_PADDED_H_
+#pragma once
 
 #include <algorithm>
 #include <cassert>
@@ -346,8 +345,9 @@ class Adaptor {
       lastCount_(lastCount) {
   }
   explicit Adaptor(size_t n, const value_type& value = value_type())
-    : c_(Node::nodeCount(n), fullNode(value)),
-      lastCount_(n % Node::kElementCount ?: Node::kElementCount) {
+    : c_(Node::nodeCount(n), fullNode(value)) {
+    const auto count = n % Node::kElementCount;
+    lastCount_ = count != 0 ? count : Node::kElementCount;
   }
 
   Adaptor(const Adaptor&) = default;
@@ -512,5 +512,3 @@ class Adaptor {
 
 }  // namespace padded
 }  // namespace folly
-
-#endif /* FOLLY_PADDED_H_ */