"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.