Skip to content
Tcl Source Code Artifact [67c67fa4cb]
Login

Artifact [67c67fa4cb]

Artifact 67c67fa4cb17b1f3b24b432eb925e024b0b974e0:

Ticket change [67c67fa4cb] - Ticket [a4a7f2abd376b280|a4a7f2abd3] <i>Tcl [string match] and [glob] are exponential complexity for bad patterns, could be linear</i> status still Open with 3 other changes by aku on 2017-05-06 03:36:22.
D 2017-05-06T03:36:22.262
J icomment Questions\sfrom\sreading\sthe\schanges\s(the\sswitches(sic)\sbetween\sif/switch/if/switch\smade\sit\sa\sbit\shard\s(*)).\r\n\r\nYou\shave\s(a)\r\n>\spnext\s=\spattern\s-\s1;\r\n>\ssnext\s=\sstr;\r\n\r\nwhere\sRuss\shas\r\n>\snextPx\s=\spx\r\n>\snextNx\s=\snx\s+\s1\r\n\r\nSo,\syou\sare\sstoring\s-1\srelative\sto\swhat\she\sdoes.\r\n\r\nLater,\swhere\sthe\snext-values\sare\sused\sto\srestart\sI\ssee\spartial\scompensation\sfor\sthis\s-1,\si.e.\s(b)\r\n>\spattern\s=\spnext;\r\n>\sstr\s=\ssnext\s+\sTclUtfToUniChar(str,\s&sch);\r\n\r\nstr\scompensates,\spattern\sdoes\snot\sseem\sto.\r\n\r\nFor\scompleteness\sof\scomparison,\sRuss'\sequivalent\scode\sis\r\n>\spx\s=\snextPx\r\n>\snx\s=\snextNx\r\n\r\nCan\syou\sexplain\s?\r\nAlso,\swould\sgetting\srid\sof\sboth\sthe\s-1\sin\s(a)\sand\sthe\scompensation\si\s(b)\sstill\swork\s?\r\nIf\syes\sI\swould\sconsider\sthat\ssimpler,\sespecially\sas\swe\swould\sloose\sthe\s(semi-expensive)\sTclUtfToUniChar\sneeded\sin\s(b)\r\n\r\n\r\n(*)\sIn\sthe\send\sI\sused\sfossil's\sweb\sdiff\swhere\syou\scan\sclick\son\sthe\s(*)-marks\sof\stwo\srevisions\sto\sget\sa\sdiff\sbetween\sthem,\sto\ssee\sonly\sone\schange\sif/switch.
J login aku
J mimetype text/plain
K a4a7f2abd376b2806073d2865f07b7d910b04574
U aku
Z f91ae9ecebce07eb488eb434f4b40661