• ugo@feddit.it
    link
    fedilink
    arrow-up
    16
    arrow-down
    3
    ·
    1 year ago

    If this was cpp, clang-tidy would tell you “do not use else after return”

    I don’t know how null works in swift, but assuming it coerces to bool I’d write

    if (a) return a;
    return b;