Replaced for x in $list with $tuple

Tuples are static and smaller memory wise
This commit is contained in:
A_D committed 2020-07-10 06:01:47 +02:00
1 parent 87ad0f3080
commit be9ac29a5b
1 file changed
+6 -1
+6 -1
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)