HomeClusterLabs Projects

Refactor: tools,libs: Use g_list_foreach where it's easy to do so.

Description

Refactor: tools,libs: Use g_list_foreach where it's easy to do so.

While we iterate over GLists in a ton of places, there are a
surprisingly small number of places that we can just swap to using
g_list_foreach. This patch makes the switch where possible. There are
various reasons why the others can't be changed:

  • The for loop does more than just a single function call, and I didn't want to make a bunch of new functions out of the loop bodies.
  • The for loop has a conditional that prevents us from iterating over every single element.
  • The single function call puts its two arguments in a different order than a GFunc is defined, and it's a public function that cannot be changed.
  • The single function call takes more arguments than just the loop element and a user_data style argument.
  • The function being called varies for each element of the list. Essentially, something like ele->fns->whatever() is being called.

Details

Provenance
clumensAuthored on Aug 10 2021, 3:31 PM
Parents
rP99007a0030e3: Merge pull request #2459 from waltdisgrace/doc-fix
Branches
Unknown
Tags
Unknown

Event Timeline