lldp: refactor processing all lldp-neighbors
authorThomas Haller <thaller@redhat.com>
Fri, 11 Mar 2016 11:34:30 +0000 (12:34 +0100)
committerThomas Haller <thaller@redhat.com>
Thu, 17 Mar 2016 14:00:48 +0000 (15:00 +0100)
commita16da9c6a8259d4a0b48a955988a83b3031498e6
tree02b2434eee9a58997b6ce2757cc2bf2120fdaba9
parente66c581c11bff7f6e3f7cfd699ca739dc2190ff3
lldp: refactor processing all lldp-neighbors

Instead of replacing the whole hash with a new one (and all new by a new one,
LldpNeighbor instances), update the existing hash.

One point of this is that our process-all function requires less
comparisons and avoids duplicate work right earlier. E.g. if a neighbor
didn't change, we don't have to put it into a hash to compare later for
equality.

But more importantly, we preserve our LldpNeighbor instance instead
of recreating them all the time. Later, the LldpNeighbor will cache
the GVariant.
src/devices/nm-lldp-listener.c