[Tarantool-patches] [PATCH] Fix assignment operation in assertions
Nikita Pettik
korablev at tarantool.org
Sat Jun 27 22:40:40 MSK 2020
Accidentally assignment is used in assertions instead of comparison
operation. Let's fix this mistake and use comparison.
---
Nothing serious, fortunatelly.
Branch: https://github.com/tarantool/tarantool/tree/np/vinyl-fix-asserts
src/box/key_def.c | 2 +-
src/box/vinyl.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/box/key_def.c b/src/box/key_def.c
index 18af44961..a03537227 100644
--- a/src/box/key_def.c
+++ b/src/box/key_def.c
@@ -123,7 +123,7 @@ void
key_def_copy(struct key_def *dest, const struct key_def *src)
{
size_t sz = key_def_copy_size(src);
- assert(sz = key_def_copy_size(dest));
+ assert(sz == key_def_copy_size(dest));
key_def_copy_impl(dest, src, sz);
}
diff --git a/src/box/vinyl.c b/src/box/vinyl.c
index 6f06f9b11..fd9b7e6c0 100644
--- a/src/box/vinyl.c
+++ b/src/box/vinyl.c
@@ -3528,7 +3528,7 @@ vinyl_iterator_primary_next(struct iterator *base, struct tuple **ret)
{
double start_time = ev_monotonic_now(loop());
- assert(base->next = vinyl_iterator_primary_next);
+ assert(base->next == vinyl_iterator_primary_next);
struct vinyl_iterator *it = (struct vinyl_iterator *)base;
struct vy_lsm *lsm = it->iterator.lsm;
assert(lsm->index_id == 0);
@@ -3566,7 +3566,7 @@ vinyl_iterator_secondary_next(struct iterator *base, struct tuple **ret)
{
double start_time = ev_monotonic_now(loop());
- assert(base->next = vinyl_iterator_secondary_next);
+ assert(base->next == vinyl_iterator_secondary_next);
struct vinyl_iterator *it = (struct vinyl_iterator *)base;
struct vy_lsm *lsm = it->iterator.lsm;
assert(lsm->index_id > 0);
--
2.17.1
More information about the Tarantool-patches
mailing list