about summary refs log tree commit diff stats
path: root/search.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-01-13 09:10:48 -0800
committerKartik K. Agaram <vc@akkartik.com>2023-01-13 09:10:48 -0800
commit22bf3da7de9074c6b99d8e43e3ab1772aed7b059 (patch)
tree1f6590d5b3aba69f5a63d8cf93dbd5207a8d8c37 /search.lua
parente8ec87255f94db9c6f1a0db10449f6304440a350 (diff)
downloadlines.love-22bf3da7de9074c6b99d8e43e3ab1772aed7b059.tar.gz
reduce use of rfind
Diffstat (limited to 'search.lua')
-rw-r--r--search.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/search.lua b/search.lua
index 37306f8..f7d4732 100644
--- a/search.lua
+++ b/search.lua
@@ -116,6 +116,8 @@ function find(s, pat, i, plain)
   return s:find(pat, i, plain)
 end
 
+-- TODO: avoid the expensive reverse() operations
+-- Particularly if we only care about literal matches, we don't need all of string.find
 function rfind(s, pat, i, plain)
   if s == nil then return end
   local rs = s:reverse()