From d57f9a16b1428fab216e5f3e2ec1e2f8c1f9aefc Mon Sep 17 00:00:00 2001 From: sihuihan88 Date: Wed, 2 May 2018 03:10:11 -0700 Subject: [PATCH] [lua]: use not to check whether the field exists (#492) Signed-off-by: Sihui Han --- orchagent/pfc_restore.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchagent/pfc_restore.lua b/orchagent/pfc_restore.lua index ae0af506d506..5b3e4ed04649 100644 --- a/orchagent/pfc_restore.lua +++ b/orchagent/pfc_restore.lua @@ -24,7 +24,7 @@ for i = n, 1, -1 do if not big_red_switch_mode and pfc_wd_status ~= 'operational' and pfc_wd_action ~= 'alert' and restoration_time and restoration_time ~= '' then restoration_time = tonumber(restoration_time) local time_left = redis.call('HGET', counters_table_name .. ':' .. KEYS[i], 'PFC_WD_RESTORATION_TIME_LEFT') - if time_left == nil then + if not time_left then time_left = restoration_time else time_left = tonumber(time_left)