Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Does anynone see what's so speial about this loop ?

31 views
Skip to first unread message

Bonita Montero

unread,
Nov 23, 2022, 10:50:23 AM11/23/22
to
for( BOOL (WINAPI *getProcess)( HANDLE, LPPROCESSENTRY32W ) =
Process32FirstW; ; )
{
PROCESSENTRY32W pew;
pew.dwSize = sizeof(PROCESSENTRY32W);
if( !getProcess( xhSnapshot.get(), &pew ) )
break;
processes.emplace_back( pew, true, process_it(), process_it() );
getProcess = Process32NextW;
}

Andrey Tarasevich

unread,
Nov 23, 2022, 6:30:35 PM11/23/22
to
Someone failed to take advantage of the opportunity to put `getProcess =
Process32NextW` into the loop header

for( BOOL (WINAPI *getProcess)( HANDLE, LPPROCESSENTRY32W ) =
Process32FirstW; ; getProcess = Process32NextW)

?

Bonita Montero

unread,
Nov 23, 2022, 11:19:51 PM11/23/22
to
I wouldn't do that because of my taste that the for()-line
shouldn't be so long.

Andrey Tarasevich

unread,
Nov 24, 2022, 1:25:00 PM11/24/22
to
I would, because of my taste that whenever possible, loops should
support plain `continue`, i.e. immediate `continue` should not break
iteration logic.

--
Best regards,
Andrey


Bonita Montero

unread,
Nov 24, 2022, 10:31:45 PM11/24/22
to
Am 24.11.2022 um 19:24 schrieb Andrey Tarasevich:

> I would, because of my taste that whenever possible, loops should
> support plain `continue`, i.e. immediate `continue` should not break
> iteration logic.

You're compulsive.


0 new messages