From: Andreas K. <and...@ac...> - 2006-08-08 18:22:27
|
Is the change below something the Tcl RE bytecompiler does automagically ? Could it be done ? https://sourceforge.net/tracker/?func=detail&atid=112883&aid=1536890&group_id=12 883 Category: ncgi Submitted By: yahalom emet (yahalom) Summary: regexp usage is inefficient and can hang using regexp in ::ncgi::nvlist is slower that the usage of string methods (although it looks better). regexp also causes problems with bigger data which can cause ncgi to get stuck (try running it on big post data). replace: if {![regexp -- (.*)=(.*) $x dummy varname val]} { set varname anonymous set val $x } with: set idx [string last "=" $x] if {$idx==-1} { set varname anonymous set val $x } else { set varname [string range $x 0 [expr {$idx-1}]] set val [string range $x [expr {$idx+1}] end] } -- Andreas Kupries <and...@Ac...> Developer @ http://www.ActiveState.com Tel: +1 778-786-1122 |