1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

Replaced for x in $list with $tuple

Tuples are static and smaller memory wise
This commit is contained in:
A_D 2020-07-10 05:47:38 +02:00
parent 87ad0f3080
commit be9ac29a5b
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -157,7 +157,11 @@ def export(data, filename=None):
string = '[{}]\n'.format(_ships)
for slot in ['H', 'L', 'M', 'S', 'U', None, 'BH', 'RB', 'TM', 'FH', 'EC', 'PC', 'SS', 'FS', None, 'MC', None, '9', '8', '7', '6', '5', '4', '3', '2', '1']:
SLOT_TYPES = (
'H', 'L', 'M', 'S', 'U', None, 'BH', 'RB', 'TM', 'FH', 'EC', 'PC', 'SS', 'FS', None, 'MC', None, '9', '8',
'7', '6', '5', '4', '3', '2', '1'
)
for slot in SLOT_TYPES:
if not slot:
string += '\n'
@ -172,6 +176,7 @@ def export(data, filename=None):
assert companion.ship_map[data['ship']['name'].lower()] in ships, companion.ship_map[data['ship']['name'].lower()]
try:
# TODO: broken link
# https://github.com/cmmcleod/coriolis/blob/master/app/js/shipyard/module-shipyard.js#L184
mass += ships[companion.ship_map[data['ship']['name'].lower()]]['hullMass']
string += 'Mass : {:.2f} T empty\n {:.2f} T full\n'.format(mass, mass + fuel + cargo)