From 05d69831e57996d09d9c6d9b135d141d6c051035 Mon Sep 17 00:00:00 2001 From: Kristijan Husak Date: Thu, 17 Oct 2024 09:03:47 +0200 Subject: [PATCH] chore: Use util function for reversing order --- lua/orgmode/files/headline.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lua/orgmode/files/headline.lua b/lua/orgmode/files/headline.lua index 10888384..8c6cc484 100644 --- a/lua/orgmode/files/headline.lua +++ b/lua/orgmode/files/headline.lua @@ -243,11 +243,7 @@ function Headline:get_outline_path() end -- reverse headline order - local outer_to_inner_parent_headlines = {} - for i = #inner_to_outer_parent_headlines, 1, -1 do - table.insert(outer_to_inner_parent_headlines, inner_to_outer_parent_headlines[i]) - end - + local outer_to_inner_parent_headlines = utils.reverse(inner_to_outer_parent_headlines) local outline_path = table.concat(outer_to_inner_parent_headlines, '/') return outline_path end