]> git.ipfire.org Git - location/libloc.git/commit
network: Optimise _subnet function
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Nov 2020 18:36:48 +0000 (18:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Nov 2020 18:36:48 +0000 (18:36 +0000)
commita5967330d530504db401540d4bcd5474fe00e421
tree6ed59859868a34cb367ba9c484f420e08909dbf4
parenta1024390795d60fab9f697fa230c9901ebd7d221
network: Optimise _subnet function

This function used to create a network list which always
had exactly two elements. Since splitting a network in half
always returns two parts, we can simply return them as a
pointer.

This improves returning the network tree by about 17%.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/loc/network.h
src/network.c
src/test-network.c