From 6e46fe718025da5ad7e85f298a53ddbd697e65a1 Mon Sep 17 00:00:00 2001 From: glepnir Date: Mon, 3 Jun 2024 14:02:20 +0800 Subject: [PATCH] perf: luajit tips optimize --- lua/indentmini/init.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/indentmini/init.lua b/lua/indentmini/init.lua index 2b31cdb..e6c68c8 100644 --- a/lua/indentmini/init.lua +++ b/lua/indentmini/init.lua @@ -46,9 +46,7 @@ local function non_or_space(row, col) end local function find_in_snapshot(lnum) - if not cache.snapshot[lnum] then - cache.snapshot[lnum] = { get_indent_lnum(lnum), line_is_empty(lnum) } - end + cache.snapshot[lnum] = cache.snapshot[lnum] or { get_indent_lnum(lnum), line_is_empty(lnum) } return unpack(cache.snapshot[lnum]) end