From 4c986a70a4b448e6fe5d63cb715c1d063484269f Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Mon, 29 Oct 2012 09:39:09 -0700 Subject: [PATCH] Really fix the SBS-1 pruning issue this time. --- python/sbs1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/sbs1.py b/python/sbs1.py index 777ac39..8de8927 100644 --- a/python/sbs1.py +++ b/python/sbs1.py @@ -52,9 +52,9 @@ class output_sbs1(air_modes.parse): # Checking to see if we need to clean up in the event that the # dictionary is getting too large. if len(self._aircraft_id_map) > 1e4: - earliest = len(self._aircraft_id_map) - 1e4 + minimum = min(self._aircraft_id_map.values()) + (len(self_aircraft_id_map) - 1e4) for icao, _id in self._aircraft_id_map: - if _id < earliest: + if _id < minimum: del self._aircraft_id_map[icao] # Finally return the new pair