From 9591a8f01e6fad6d014ad10f4729550809680b61 Mon Sep 17 00:00:00 2001 From: Pablo Diehl Date: Tue, 11 Aug 2020 09:23:44 -0300 Subject: [PATCH] feat: replace gfind with gmatch The `gfind` method was deprecated on `Lua 5.1` and is not available in `Lua 5.2 (or later versions)` and `Luajit` (which is the one I'm using fo the project I intended to use lua-radixtree). So, my suggestion here is to replace the usages of `gfind` with `gmatch`. --- src/radix.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/radix.lua b/src/radix.lua index 99dbb7c..0531c80 100644 --- a/src/radix.lua +++ b/src/radix.lua @@ -85,7 +85,7 @@ local new = function() -- adds a new element to the tree local add_to_tree = function(word) local t = j.radix_tree - for char in word:gfind('.') do + for char in word:gmatch('.') do if t[char] == true or t[char] == nil then t[char] = {} end @@ -98,7 +98,7 @@ local new = function() -- removes an element from the tree local remove_from_tree = function(word) local t = j.radix_tree - for char in word:gfind('.') do + for char in word:gmatch('.') do if t[char] == true then return end