* limitations under the License.
*/
-#ifndef FOLLY_PADDED_H_
-#define FOLLY_PADDED_H_
+#pragma once
#include <algorithm>
#include <cassert>
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;
} // namespace padded
} // namespace folly
-
-#endif /* FOLLY_PADDED_H_ */