[Tarantool-patches] [PATCH 3/3] txn_limbo: simplify txn_limbo_ack

Cyrill Gorcunov gorcunov at gmail.com
Mon Apr 19 11:37:19 MSK 2021


There is no need to test @confirm_lsn at all because
even with value -1 we're to continue iterating the queue.
Lets drop it and save a branch.

I keep "continue" here to be consistent with other "if"s.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 src/box/txn_limbo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c
index 2a10bd0ae..227b74764 100644
--- a/src/box/txn_limbo.c
+++ b/src/box/txn_limbo.c
@@ -505,8 +505,7 @@ txn_limbo_ack(struct txn_limbo *limbo, uint32_t replica_id, int64_t lsn)
 		 */
 		if (!txn_has_flag(e->txn, TXN_WAIT_ACK)) {
 			assert(e->lsn == -1);
-			if (confirm_lsn == -1)
-				continue;
+			continue;
 		} else if (e->lsn <= prev_lsn) {
 			continue;
 		} else if (++e->ack_count < replication_synchro_quorum) {
-- 
2.30.2



More information about the Tarantool-patches mailing list