[Tarantool-patches] [PATCH 3/5] qsync: txn_commit_async -- drop redundant variable

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


Flag test is enough no need for additional variable.
And move limbo_entry declaration into the scope where
it belongs.

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

diff --git a/src/box/txn.c b/src/box/txn.c
index 4251b2092..613eb7aef 100644
--- a/src/box/txn.c
+++ b/src/box/txn.c
@@ -732,9 +732,8 @@ txn_commit_async(struct txn *txn)
 		return -1;
 	}
 
-	bool is_sync = txn_has_flag(txn, TXN_WAIT_SYNC);
-	struct txn_limbo_entry *limbo_entry;
-	if (is_sync) {
+	if (txn_has_flag(txn, TXN_WAIT_SYNC)) {
+		struct txn_limbo_entry *limbo_entry;
 		/*
 		 * We'll need this trigger for sync transactions later,
 		 * but allocation failure is inappropriate after the entry
-- 
2.26.2



More information about the Tarantool-patches mailing list