Skip to content

Commit

Permalink
Small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrb93 committed Aug 30, 2024
1 parent 31cb00d commit 58bda9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/starfall/libs_sh/builtins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 58bda9f

Please sign in to comment.