Optimized the retrival of total fits for a specific ship ID -> make use of eos.db.saveddata.queries.countFitsWithShip
This commit is contained in:
@@ -175,7 +175,7 @@ class ShipBrowser(wx.Panel):
|
||||
|
||||
ships.sort(key=self.raceNameKey)
|
||||
for ship in ships:
|
||||
fits = len(sFit.getFitsWithShip(ship.ID))
|
||||
fits = sFit.countFitsWithShip(ship.ID)
|
||||
if self.filterShipsWithNoFits:
|
||||
if fits>0:
|
||||
self.lpane.AddWidget(ShipItem(self.lpane, ship.ID, (ship.name, fits), ship.race))
|
||||
|
||||
@@ -91,6 +91,9 @@ class Fit(object):
|
||||
|
||||
return names
|
||||
|
||||
def countFitsWithShip(self,id):
|
||||
return eos.db.countFitsWithShip(id)
|
||||
|
||||
def getModule(self, fitID, pos):
|
||||
fit = eos.db.getFit(fitID)
|
||||
return fit.modules[pos]
|
||||
|
||||
Reference in New Issue
Block a user