From 671db638b8bb155b3329b11a47a90ac44d47138a Mon Sep 17 00:00:00 2001
From: Vladimir Davydov <vdavydov@tarantool.org>
Date: Tue, 1 Aug 2023 14:14:40 +0300
Subject: [PATCH] Use compat.option:is_old where appropriate

The is_old compat option method is more reliable than comparing
the current option value to 'old' directly because it may be set to
'default', in which case we also have to check the default value.

Follow-up #8807

NO_DOC=refactoring
NO_TEST=refactoring
NO_CHANGELOG=refactoring
---
 src/box/lua/config/instance_config.lua | 2 +-
 src/box/lua/tuple.lua                  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/box/lua/config/instance_config.lua b/src/box/lua/config/instance_config.lua
index a9e8425df2..c26ea2ad85 100644
--- a/src/box/lua/config/instance_config.lua
+++ b/src/box/lua/config/instance_config.lua
@@ -991,7 +991,7 @@ return schema.new('instance_config', schema.record({
         sync_timeout = schema.scalar({
             type = 'number',
             box_cfg = 'replication_sync_timeout',
-            default = compat.box_cfg_replication_sync_timeout.default == 'old'
+            default = compat.box_cfg_replication_sync_timeout:is_old()
                 and 300 or 0,
         }),
         sync_lag = schema.scalar({
diff --git a/src/box/lua/tuple.lua b/src/box/lua/tuple.lua
index 200308aab1..1cfe6c2548 100644
--- a/src/box/lua/tuple.lua
+++ b/src/box/lua/tuple.lua
@@ -76,7 +76,7 @@ local NEW_OPTION_TYPES = {
 }
 
 local new_tuple = function(...)
-    if compat.box_tuple_new_vararg.current == 'old' then
+    if compat.box_tuple_new_vararg:is_old() then
         return internal.tuple.new{...}
     end
     local tuple, options = ...
-- 
GitLab