[Tarantool-patches] [PATCH 5/5] qsync: sanitize txn_limbo_on_rollback

Cyrill Gorcunov gorcunov at gmail.com
Fri Jul 10 10:56:05 MSK 2020


 - no need to explicit cast from void
 - shrink changing condition
 - drop unneed reference to event

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 src/box/txn.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/box/txn.c b/src/box/txn.c
index feb9a10c6..6cd2a346e 100644
--- a/src/box/txn.c
+++ b/src/box/txn.c
@@ -691,13 +691,12 @@ txn_commit_nop(struct txn *txn)
 static int
 txn_limbo_on_rollback(struct trigger *trig, void *event)
 {
-	(void) event;
-	struct txn *txn = (struct txn *) event;
+	struct txn *txn = event;
 	/* Check whether limbo has performed the cleanup. */
-	if (txn->signature != TXN_SIGNATURE_ROLLBACK)
-		return 0;
-	struct txn_limbo_entry *entry = (struct txn_limbo_entry *) trig->data;
-	txn_limbo_abort(&txn_limbo, entry);
+	if (txn->signature == TXN_SIGNATURE_ROLLBACK) {
+		struct txn_limbo_entry *e = trig->data;
+		txn_limbo_abort(&txn_limbo, e);
+	}
 	return 0;
 }
 
-- 
2.26.2



More information about the Tarantool-patches mailing list