[Tarantool-patches] [PATCH] vclock: refactor vclock map to use type uint32_t
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu Mar 5 23:46:06 MSK 2020
Hi! Thanks for the patch!
Consider this diff:
====================
diff --git a/src/box/vclock.h b/src/box/vclock.h
index 9b499513a..a8549d2a9 100644
--- a/src/box/vclock.h
+++ b/src/box/vclock.h
@@ -195,7 +195,7 @@ vclock_copy(struct vclock *dst, const struct vclock *src)
static inline uint32_t
vclock_size(const struct vclock *vclock)
{
- return __builtin_popcount(vclock->map);
+ return bit_count_u32(vclock->map);
}
static inline int64_t
@@ -281,7 +281,7 @@ vclock_compare_generic(const struct vclock *a, const struct vclock *b,
bool ignore_zero)
{
bool le = true, ge = true;
- unsigned int map = a->map | b->map;
+ uint32_t map = a->map | b->map;
struct bit_iterator it;
bit_iterator_init(&it, &map, sizeof(map), true);
More information about the Tarantool-patches
mailing list