From 4a98a9bb0b7d587be3d69738ed1d5ce77c1bf3b7 Mon Sep 17 00:00:00 2001 From: Nikita Pettik <korablev@tarantool.org> Date: Mon, 18 May 2020 18:57:58 +0300 Subject: [PATCH] vinyl: fix comment to vy_read_iterator_cmp_stmt() vy_read_iterator_cmp_stmt() uses tuple_compare_with_key() under the hood which follows next convention: (a) it returns 0 if key_fields of tuple equal to given key; (b) < 0 if key_fields less than given key; (c) > 0 otherwise. However, comment to vy_read_iterator_cmp_stmt() says that: (a) it returns -1 if first statement precedes second one; (b) 0 if they at the same position; (c) +1 if first statement supersedes second one. so, since there's no "normalization" of return code from tuple_compare_with_key() it would be correct to say that vy_read_iterator_cmp_stmt() returns: (a) it returns arbitrary integer value < 0 if first statement precedes second one; (b) 0 if they at the same position; (c) arbitrary integer value > 0 if first statement supersedes second one. --- src/box/vy_read_iterator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/box/vy_read_iterator.c b/src/box/vy_read_iterator.c index 9ea07709e5..dcc9a08733 100644 --- a/src/box/vy_read_iterator.c +++ b/src/box/vy_read_iterator.c @@ -168,9 +168,9 @@ vy_read_iterator_range_is_done(struct vy_read_iterator *itr, * Compare two tuples from the read iterator perspective. * * Returns: - * -1 if statement @a precedes statement @b in the iterator output - * 0 if statements @a and @b are at the same position - * 1 if statement @a supersedes statement @b + * < 0 if statement @a precedes statement @b in the iterator output + * == 0 if statements @a and @b are at the same position + * > 0 if statement @a supersedes statement @b * * NULL denotes the statement following the last one. */ -- GitLab