HomeClusterLabs Projects

Refactor: libcrmcommon: de-indent an "else" block in update_validation()

Description

Refactor: libcrmcommon: de-indent an "else" block in update_validation()

The logic is convoluted, and this is a step toward untangling it. The previous
code had a while loop containing this logic:

if (validate_with...) {
    ...
    rc = -pcmk_err_schema_validation;

} else {
    ...
    rc = pcmk_ok;
}

if (rc == pcmk_ok) {
    ...
}

if (rc == pcmk_ok && transform) {
    ...
}

if (transform == FALSE || rc != pcmk_ok) {
    /* we need some progress! */
    lpc++;
}

If the first "if" block hit, then it would skip everything except the lpc++.
Now, just do that lpc++ in the "if" block and "continue", so the "else" block
gets de-indented. The rest of the code does not change in this commit, for ease
of review.

Details

Provenance
kgaillotAuthored on Apr 17 2024, 12:58 PM
Parents
rPb099ba9c19cd: Refactor: libcrmcommon: move an "if" block in update_validation()
Branches
Unknown
Tags
Unknown