HomeClusterLabs Projects

Refactor: libcrmcommon: Avoid strlen() in pcmk__xml_needs_escape()

Description

Refactor: libcrmcommon: Avoid strlen() in pcmk__xml_needs_escape()

We don't need to maintain a pointer to the beginning of the string, so
just increment the text pointer.

Also make the increment logic a bit more readable, at the expense of
converting the for-loop to a while loop.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 23 2024, 3:25 PM
Parents
rPd6daa67bfb49: Refactor: libcrmcommon: Sanity-check utf8_bytes() result
Branches
Unknown
Tags
Unknown