From 58bda9f0fca0a62df344832450a4a088de27b328 Mon Sep 17 00:00:00 2001 From: thegrb93 Date: Fri, 30 Aug 2024 03:55:47 -0400 Subject: [PATCH] Small optimization --- lua/starfall/libs_sh/builtins.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/starfall/libs_sh/builtins.lua b/lua/starfall/libs_sh/builtins.lua index 3b60ac906..f60c01585 100644 --- a/lua/starfall/libs_sh/builtins.lua +++ b/lua/starfall/libs_sh/builtins.lua @@ -777,8 +777,9 @@ function builtins_library.requiredir(path, loadpriority) if loadpriority~=nil then checkluatype(loadpriority, TYPE_TABLE) end path = SF.ChoosePath(path, string.GetPathFromFilename(SF.GetExecutingPath() or ""), function(testpath) + testpath = testpath .. "/" for file in pairs(instance.scripts) do - if testpath == string.sub(string.GetPathFromFilename(file), 1, -2) then + if testpath == string.GetPathFromFilename(file) then return true end end @@ -830,8 +831,9 @@ function builtins_library.dodir(path, loadpriority) if loadpriority ~= nil then checkluatype(loadpriority, TYPE_TABLE) end path = SF.ChoosePath(path, string.GetPathFromFilename(SF.GetExecutingPath() or ""), function(testpath) + testpath = testpath .. "/" for file in pairs(instance.scripts) do - if testpath == string.sub(string.GetPathFromFilename(file), 1, -2) then + if testpath == string.GetPathFromFilename(file) then return true end end