[PATCH] mi: sprite: SaveUnderCursor2

Matt Turner mattst88 at gmail.com
Thu Mar 11 03:31:19 UTC 2021


On Tue, Mar 9, 2021 at 1:20 PM Walter Harms <wharms at bfs.de> wrote:
>
> hi Madhurkiran Harikrishnan,
> my experience is that readability reduced rapidly with indent-level.
> I would suggest:
>
>  if ( ! DevHasCursor(pDev) continue;
>
> pCursorInfo = GetSprite(pDev);
>
> if (!pCursorInfo) continue; // just to shrink the if ()
>
>
> // no braces needed
>  if ( pCursorInfo->isUp &&
>        pCursorInfo->pScreen == pScreen)
>                  miSpriteSaveUnderCursor(pDev, pScreen);

Not using braces here, with a line-wrapped conditional, is a bad idea.
Especially in nested control flow.


More information about the xorg-devel mailing list