Latest post of the previous page:
у меня в 4,5 раза. а вот если пробелы на конце убрать, то match дольше в 6 раз. а ведь отсутствие пробелов в среднем будет гораздо чаще встречаться. я у себя в макро аналоге [esc] такое использую:
Code: Select all
KillSpaces1=(id,lineno,mms=false,spaces=true,eol)->
line=editor.GetString id,lineno,0
eol=(eol and line.StringEOL\len!>0) and eol or line.StringEOL
replaces=0
if spaces and (not mms or line.StringText!="-- ") then line.StringText,replaces=line.StringText\gsub "%s+$",""
if replaces>0 or eol!=line.StringEOL then editor.SetString id,lineno,line.StringText,eol