mercredi 27 mai 2020

Is there a benefit/downside to return in an else statement? [duplicate]

Version 1:

int abc(...)
{
    if(a || b || c))
        return 1;
    else
        return 0;
}

Version 2:

int abc(...)
{
    if(a || b || c))
        return 1;

    return 0;
}

Is there any difference? Which code is the proper one?

Aucun commentaire:

Enregistrer un commentaire