From 504f9265b2c55acd5477eb417f3a3709b212df68 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Mon, 29 Oct 2012 09:19:04 -0700 Subject: [PATCH] Fix for SBS-1 get_aircraft_id list cleanup. --- python/sbs1.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/sbs1.py b/python/sbs1.py index 480eff5..777ac39 100644 --- a/python/sbs1.py +++ b/python/sbs1.py @@ -52,11 +52,10 @@ 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: - minimum = ('', self._aircraft_id_count) - for pair in self._aircraft_id_map: - if pair[1] < minimum[1]: - minimum = pair - self._aircraft_id_map.pop(minimum[0]) + earliest = len(self._aircraft_id_map) - 1e4 + for icao, _id in self._aircraft_id_map: + if _id < earliest: + del self._aircraft_id_map[icao] # Finally return the new pair return self._aircraft_id_count