Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2018-04-17 12:47:04 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2018-04-17 12:47:50 +0300
commitf9f9ee72e9b776eaa94ef11f48ae0d842b5218f0 (patch)
treef6807913fa2657424f093961a3d9a56055040e95 /base
parent9bfff1ff825ce30114dce3e6b98f9a1c083c72fd (diff)
Review fixes.
Diffstat (limited to 'base')
-rw-r--r--base/base_tests/bits_test.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/base/base_tests/bits_test.cpp b/base/base_tests/bits_test.cpp
index 4791164750..5b54310205 100644
--- a/base/base_tests/bits_test.cpp
+++ b/base/base_tests/bits_test.cpp
@@ -3,20 +3,24 @@
#include "base/bits.hpp"
#include "base/checked_cast.hpp"
+#include <cstdint>
#include <cstdlib>
#include <vector>
namespace
{
- template <typename T> uint32_t PopCountSimple(T x)
+template <typename T>
+uint32_t PopCountSimple(T x)
+{
+ uint32_t res = 0;
+ for (; x != 0; x >>= 1)
{
- uint32_t res = 0;
- for (; x != 0; x >>= 1)
- if (x & 1)
- ++res;
- return res;
+ if (x & 1)
+ ++res;
}
+ return res;
}
+} // namespace
UNIT_TEST(Popcount32)
{