HomeClusterLabs Projects

Refactor: based: cib_get_operation_id() -> cib_get_operation()

Description

Refactor: based: cib_get_operation_id() -> cib_get_operation()

Currently, we get the operation's integer ID (more accurately its index
in an internal array) and then pass that index to various getter
functions.

However, those getter functions are all very simple. If we remove the
getters, we can simplify the code by returning a const pointer to the
cib_operation_t struct and accessing its members directly -- thus
eliminating the "call_type" integer variable.

Continue returning a legacy RC rather than a const cib_operation_t *
from cib_get_operation(), to simplify error handling in callers.

Closes T658

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

Details

Provenance
nrwahl2Authored on May 10 2023, 2:14 AM
Parents
rP763c619dea35: Refactor: based, libcib: Replace cib_op_t * with cib_op_t
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task