Message info
 
To:python-bugs-list@python.org From:Glenn Linderman Subject:[issue14565] is_cgi doesn\'t function as documented for cgi_directories Date:Mon, 07 May 2012 21:15:36 +0000
 


Glenn Linderman <v+python@g.nevcal.com> added the comment:

Hi Pierre,

You are right, the "found" variable is not needed, I guess the reason I coded it that way, is I had some validation code before the return, during testing, so it was easier not to have it in three places.

Regarding precalculating ln, I don't know how Python is coded internally, so it seems that string compares could be lengthier integer compares, and even in your code the length is calculated sometimes. So it is mostly an order of operations optimization... I didn't attempt to benchmark it with various URL and cgi_directories values, including at least both some with large prefix matches, and some without... I didn't figure it would matter much, but if you think it does, then feel free to benchmark.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue14565>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40all-mail-archive.com