]> git.ipfire.org Git - people/ms/libloc.git/commit - src/database.c
database: Allocate subnets list only once
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 30 Mar 2022 14:58:36 +0000 (14:58 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 30 Mar 2022 14:58:36 +0000 (14:58 +0000)
commit065b34965f81995b4e6ec4d41b4ba87a79abf0df
treeda72a546957c8c47c0591b06ce0c6a7ac4e742c1
parentfcb5ce41d3745ac240a83a5a5cff2fcf53c8d4fd
database: Allocate subnets list only once

This is a performance improvement when exporting networks flattened. For
the subnet search, we allocate an empty list many times which is often
not required.

This patch changes this behaviour that (if needed) the lists will be
allocated and will stay around and cleared if necessary.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.c