]> git.puffer.fish Git - mirror/frr.git/commit
lib: optimize vrf_id_to_name(VRF_DEFAULT) case
authorChristophe Gouault <christophe.gouault@6wind.com>
Wed, 26 Aug 2020 14:26:49 +0000 (16:26 +0200)
committerChristophe Gouault <christophe.gouault@6wind.com>
Mon, 21 Sep 2020 08:07:56 +0000 (10:07 +0200)
commit7c1119cb7a1c66028d5487ff66682383244f987d
treeb41faebe98e5456ba6a1cf4c19594d9aa0c95773
parent8277d4b79662bde0ee09781ebfd4d2826b13f4f5
lib: optimize vrf_id_to_name(VRF_DEFAULT) case

vrf_id_to_name() looks up in a RB_TREE to find the VRF entry, then
reads the name.

Avoid it for VRF_DEFAULT, which always exists and for which the
translation is straightforward.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
lib/vrf.c