increase computational performance

This commit is contained in:
Sven Czarnian
2021-10-18 18:53:24 +02:00
parent d191da2303
commit 7c6d098812
6 changed files with 18 additions and 19 deletions

View File

@@ -10,24 +10,24 @@ class RecedingHorizonWindow:
def isInWindow(self, inbound : Inbound):
for report in self.Inbounds:
if report.Report.aircraft.callsign == inbound.Report.aircraft.callsign:
if report.Callsign == inbound.Callsign:
return True
return False
def inbound(self, callsign : str):
for report in self.Inbounds:
if report.Report.aircraft.callsign == callsign:
if report.Callsign == callsign:
return report
return None
def insert(self, inbound : Inbound):
for i in range(0, len(self.Inbounds)):
if self.Inbounds[i].Report.aircraft.callsign == inbound.Report.aircraft.callsign:
if self.Inbounds[i].Callsign == inbound.Callsign:
return
self.Inbounds.append(inbound)
def remove(self, callsign : str):
for i in range(0, len(self.Inbounds)):
if self.Inbounds[i].Report.aircraft.callsign == callsign:
if self.Inbounds[i].Callsign == callsign:
self.Inbounds.pop(i)
return