From 7d511a1a94fd3e241d6c050554fc132387fc16ab Mon Sep 17 00:00:00 2001
From: Aleksandr Lyapunov <alyapunov@tarantool.org>
Date: Sun, 11 Apr 2021 19:16:33 +0300
Subject: [PATCH] box: remove unused check

Since DUP_REPLACE mode is always used with given old_tuple,
there's no reason to check in runtime

Part of #5628
---
 src/box/index.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/box/index.h b/src/box/index.h
index b4b7a48c24..acfafe2a8d 100644
--- a/src/box/index.h
+++ b/src/box/index.h
@@ -472,12 +472,12 @@ replace_check_dup(struct tuple *old_tuple, struct tuple *dup_tuple,
 {
 	if (dup_tuple == NULL) {
 		if (mode == DUP_REPLACE) {
+			assert(old_tuple != NULL);
 			/*
 			 * dup_replace_mode is DUP_REPLACE, and
 			 * a tuple with the same key is not found.
 			 */
-			return old_tuple ?
-			       ER_CANT_UPDATE_PRIMARY_KEY : ER_TUPLE_NOT_FOUND;
+			return ER_CANT_UPDATE_PRIMARY_KEY;
 		}
 	} else { /* dup_tuple != NULL */
 		if (dup_tuple != old_tuple &&
-- 
GitLab