Simplify propertyNameCmp() and fix a warning in the way by removing

CRTDLL__wcsupr() calls.
This commit is contained in:
Michael Veksler 1999-04-18 09:30:07 +00:00 committed by Alexandre Julliard
parent 364c12413d
commit d785aa646f
1 changed files with 2 additions and 10 deletions

View File

@ -1130,22 +1130,14 @@ static LONG propertyNameCmp(
OLECHAR *newProperty, OLECHAR *newProperty,
OLECHAR *currentProperty) OLECHAR *currentProperty)
{ {
LONG sizeOfNew = (lstrlenW(newProperty) +1) * sizeof(WCHAR); LONG diff = lstrlenW(newProperty) - lstrlenW(currentProperty);
LONG sizeOfCur = (lstrlenW(currentProperty)+1) * sizeof(WCHAR);
LONG diff = sizeOfNew - sizeOfCur;
if (diff == 0) if (diff == 0)
{ {
/* /*
* We compare the string themselves only when they are of the same lenght * We compare the string themselves only when they are of the same lenght
*/ */
WCHAR wsnew[PROPERTY_NAME_MAX_LEN]; diff = lstrcmpiW( newProperty, currentProperty);
WCHAR wscur[PROPERTY_NAME_MAX_LEN];
diff = lstrcmpW( (LPCWSTR)CRTDLL__wcsupr(
lstrcpynW(wsnew, newProperty, sizeOfNew)),
(LPCWSTR)CRTDLL__wcsupr(
lstrcpynW(wscur, currentProperty, sizeOfCur)));
} }
return diff; return diff;