prepare-root: Use ptrarray, not linked list
authorColin Walters <walters@verbum.org>
Mon, 14 Aug 2023 18:36:50 +0000 (14:36 -0400)
committerColin Walters <walters@verbum.org>
Mon, 14 Aug 2023 18:36:50 +0000 (14:36 -0400)
commit871d32a591a256c4d0077c1d921b5d9d6e01903c
tree1a8533e1ab0519536a54de76dfa8eced63991304
parent678bfcd934e135a28fef172db675a0ae81ae85b1
prepare-root: Use ptrarray, not linked list

Linked lists are a data structure with only very obscure
use cases, and this is a classic one where since we're appending
it's O(N^2) behavior.

Also we were leaking the memory.

It's more ergonomic, clearer and efficient to use a ptrarray.
src/switchroot/ostree-prepare-root.c