http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4707





------- Additional Comments From [EMAIL PROTECTED]  2005-11-27 22:11 -------
You are all correct that what is there is ugly. I would not object to a patch
that looked better.

I started to write it differently and discovered that a "better" way did not
look all that much better. to_upper is a standard way to do this, but is not
more efficient, since that macro has to work for non-alphabetic characters,
doing more processing than the two comparisons here. A simple or-ing of x'40'
would work, but I bet after compiler optimization is not that much different in
performance, while looking a bit more opaque to a person reading the code. I
would like to do something that uses memicmp or _memicmp, but I'm not sure what
can of worms I would open up regarding cross-platform compatibility. memicmp is
deprecated in Visual Studio C++ 2005, for example, in favor of the ANSI/ISO C++
naming convention _memicmp. I don't know which platforms don't yet have
_memicmp. I don't want to introduce even more hacks for portability.

Note that this section of code is searching for the '\nDATA\n' string which
should appear quite early in the BSMTP formatted message that is passed to
spamc. Compared to passing the entire message over a network or pipe to spamd,
this one-time search for something that will be found quickly is not worth
putting in a lot of effort to optimize. If I get bored, I might do it anyway :-)




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to