diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-08-14 12:34:02 +0100 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2024-08-14 12:34:02 +0100 |
commit | 390cf8fd09fa577f9bdc7a4e3c82e6f3b2b3eacd (patch) | |
tree | 860059d116d4c0f2e6088e895b48a90fc9ed0aba /script/core/definition.lua | |
parent | 7f7c5920e91e147fad12e10c2de7c25b15df66e6 (diff) | |
download | lua-language-server-390cf8fd09fa577f9bdc7a4e3c82e6f3b2b3eacd.zip |
fixup! fast path for matching strings
Diffstat (limited to 'script/core/definition.lua')
-rw-r--r-- | script/core/definition.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/script/core/definition.lua b/script/core/definition.lua index 207fc9cc..f94d3628 100644 --- a/script/core/definition.lua +++ b/script/core/definition.lua @@ -51,6 +51,9 @@ end --- @param path2 string --- @return number local function pathSimilarityRatio(path1, path2) + if path1 == path2 then + return 0 + end local parts1 = split(path1) local parts2 = split(path2) local distance = levenshteinDistance(parts1, parts2) |