.
D 2007-07-31T11:09:09
J assignee nobody
J cmimetype text/plain
J comment Hi\sall,\n\nI\shave\srecently\snoticed\sthat\sthe\sfile\sword.tcl\sin\sthe\stcl\slibrary\shas\snot\sbeen\supdated\sto\suse\sthe\s(relatively)\snew\s-start\soption\sof\sregexp.\sChanging\sthe\sfile\sword.tcl\sto\sremove\s[string\srange\s...]\scall\sand\suse\sthe\s-start\sregexp\soption,\sall\sthe\sprocs\swere\smade\smuch\sfaster,\sespecially\sfor\slarge\sstrings.\s\nAs\san\sexample,\sthe\sbody\sof\stcl_startOfNextWord:\n\nproc\stcl_startOfNextWord\s{str\sstart}\s{\n\s\s\s\sglobal\stcl_nonwordchars\stcl_wordchars\n\s\s\s\sif\s{[regexp\s-indices\s"$tcl_wordchars*$tcl_nonwordchars+$tcl_wordchars"\s\\\n\s\s\s\s\s\s\s\s[string\srange\s$str\s$start\send]\sresult]}\s{\n\s\s\s\sreturn\s[expr\s{[lindex\s$result\s1]\s+\s$start}]\n\s\s\s\s}\n\s\s\s\sreturn\s-1\n}\n\nCan\sbe\schanged\sto:\n\nproc\stcl_startOfNextWord\s{str\sstart}\s{\n\s\s\s\sglobal\stcl_nonwordchars\stcl_wordchars\n\s\s\s\sif\s{[regexp\s-indices\s-start\s$start\s--\s\\\n"$tcl_wordchars*$tcl_nonwordchars+$tcl_wordchars"\s\\\n\s\s\s\s\s\s\s\s$str\sresult]}\s{\n\s\s\s\sreturn\s[lindex\s$result\s1]\n\s\s\s\s}\n\s\s\s\sreturn\s-1\n}
J foundin obsolete:\s8.4.16
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter petasis
J subsystem 69.\sOther
J title Improve\sperformance\son\stcl_startOfNextWord\sand\sfriends...
J type Bug
K 1764318fffffffffffffffffffffffffffffffff
U petasis
Z c4aa8977ddf7e23f4e0de0f9af05cf92