Skip to content

Fix if-else statements in various files #124

Closed

Description

@Connor-GH

Is your feature request related to a problem? Please describe.
Not a problem, but an enhancement.
I see lines like this:

if (libHandle == NVHDMIPKT_INVALID_HANDLE)

that use brackets for a singular function on the "if" statements.
(example: if(n) { printf("n\n"); } )
In reality, these brackets don't have to be there, since it's just one function for the conditional statement.

Describe the solution you'd like
Instead of

if (libHandle == NVHDMIPKT_INVALID_HANDLE)
    {
        return NVHDMIPKT_LIBRARY_INIT_FAIL;
    }

use

if (libHandle == NVHDMIPKT_INVALID_HANDLE)
        return NVHDMIPKT_LIBRARY_INIT_FAIL;

Describe alternatives you've considered
Ternary operators can also be used for if-else statements.

Additional context
This all falls under better code style, and makes no functional difference.
In my eyes, it helps for readability.

Activity

  1. added
    enhancement
    on May 12, 2022
  2. TrickyDmitriy commented on May 12, 2022

    @TrickyDmitriy
    Contributor

    This is not an enhancement and do not follows the current code style.
    So issue should be closed in order to de-clutter "Issues" board ;)

  3. Connor-GH commented on May 12, 2022

    @Connor-GH
    Author

    Fair enough.

  4. Zezombye commented on May 13, 2022

    @Zezombye
  5. removed
    enhancement
    on Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions