Francois Gouget : winmm: Avoid a couple of unneeded lstrlenW() calls.

Alexandre Julliard julliard at winehq.org
Mon Sep 16 16:33:43 CDT 2019


Module: wine
Branch: master
Commit: 6a4347be371bea544e0d4a81f4cfacd29af18d6e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6a4347be371bea544e0d4a81f4cfacd29af18d6e

Author: Francois Gouget <fgouget at free.fr>
Date:   Mon Sep 16 16:01:04 2019 +0200

winmm: Avoid a couple of unneeded lstrlenW() calls.

Note that since str is a buffer it cannot be NULL.

Signed-off-by: Francois Gouget <fgouget at free.fr>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winmm/playsound.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/winmm/playsound.c b/dlls/winmm/playsound.c
index 2731e7b935..be3f9d4c80 100644
--- a/dlls/winmm/playsound.c
+++ b/dlls/winmm/playsound.c
@@ -87,11 +87,11 @@ static HMMIO	get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName)
 
     TRACE("searching in SystemSound list for %s\n", debugstr_w(lpszName));
     GetProfileStringW(wszSounds, lpszName, wszNull, str, ARRAY_SIZE(str));
-    if (lstrlenW(str) == 0)
+    if (!*str)
     {
 	if (uFlags & SND_NODEFAULT) goto next;
 	GetProfileStringW(wszSounds, wszDefault, wszNull, str, ARRAY_SIZE(str));
-	if (lstrlenW(str) == 0) goto next;
+	if (!*str) goto next;
     }
     for (ptr = str; *ptr && *ptr != ','; ptr++);
     if (*ptr) *ptr = 0;




More information about the wine-cvs mailing list