"Charles Blacklock" charles@diagnos.co.uk wrote:
- if (lcid == 0)
- {
ret = memcmp(pbstrLeft, pbstrRight, min(SysStringByteLen(pbstrLeft), SysStringByteLen(pbstrRight)));
if (ret < 0)
return VARCMP_LT;
if (ret > 0)
return VARCMP_GT;
if (SysStringByteLen(pbstrLeft) < SysStringByteLen(pbstrRight))
return VARCMP_LT;
if (SysStringByteLen(pbstrLeft) > SysStringByteLen(pbstrRight))
return VARCMP_GT;
return VARCMP_EQ;
- }
It would be much more effective to call SysStringByteLen only once for each string instead of calling it again and again after a failing comparison.
On Fri, 2006-12-01 at 16:36 +0800, Dmitry Timoshkov wrote:
It would be much more effective to call SysStringByteLen only once for each string instead of calling it again and again after a failing comparison.
Cool, the attached patch does this now. Is this any better?
Charles
"Charles Blacklock" charles@diagnos.co.uk wrote:
Cool, the attached patch does this now. Is this any better?
Yes (although I'd personally move local variables under the "if (lcid == 0)" case), please send it to wine-patches.