From: "Gabriel Ivăncescu" Subject: Re: [PATCH 2/2] gdi32: Remove redundant check. Message-Id: <9f6e8ca4-4aac-6462-443e-3d8c8343ed1d@gmail.com> Date: Sat, 30 Jan 2021 15:44:18 +0200 In-Reply-To: <20210130132623.4A0B.375B48EC@gmail.com> References: <8060f9d9801abffa1f26d6b0fa4ad6ea5ee2941a.1611940332.git.gabrielopcode@gmail.com> <20210130132623.4A0B.375B48EC@gmail.com> On 30/01/2021 06:27, Akihiro Sagawa wrote: > On Fri, 29 Jan 2021 19:12:57 +0200, Gabriel Ivăncescu wrote: >> Signed-off-by: Gabriel Ivăncescu >> --- >> >> The type is UINT so it does nothing anyway. >> >> dlls/gdi32/font.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c >> index c0517f5..dd8265f 100644 >> --- a/dlls/gdi32/font.c >> +++ b/dlls/gdi32/font.c >> @@ -5961,7 +5961,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, >> align ^= TA_RTLREADING; >> } >> >> - if( !(flags & (ETO_GLYPH_INDEX | ETO_IGNORELANGUAGE)) && count > 0 ) >> + if (!(flags & (ETO_GLYPH_INDEX | ETO_IGNORELANGUAGE))) >> { >> INT cGlyphs; >> reordered_str = HeapAlloc(GetProcessHeap(), 0, count*sizeof(WCHAR)); > > (having forgot to cc to the list, I resend this mail.) > > The check is needed. If count variable is zero, the inner calls, e.g. > HeapAlloc, are redundant. > > Akihiro Sagawa > Yes you're right, I forgot about the zero case. I also forgot to include ExtTextOutA in the first patch...