[cups.development] [RFE] STR #2363: stop using strcasecmp()

katsura katsura at mac.com
Thu Apr 26 21:09:19 PDT 2007


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

> STR #2362
> We can't (and won't) change the code to convert keywords
> to lowercase - it would break too much code and we'd still
> need to convert the input values to lowercase...

"can't (and won't)"? that doesn't make any sense at all. you are jumping
to a conclusion with your wrong assumptions.

it can't and won't break anything if you change the code properly.

instead of converting strings to lowercase every time these need to be
compared, just convert all strings only ONCE when the ppd structure is
getting built. and you can use strcmp() instead of strcasecmp(). it's
simple as that.

btw, i'm not making random suggestions. i profile cups in the real world
usage on Mac, and strcasecmp() is now the bottleneck after all other
performance improvements.

Link: http://www.cups.org/str.php?L2363
Version:  -feature





More information about the cups-devel mailing list