1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 08:40:34 +03:00

Replaced write out checks with guard clauses

Guard clauses reduce indentation and help when reading code as they
remove a variable and indentation level that the reader would otherwise
need to keep track of
This commit is contained in:
A_D 2020-07-13 06:32:55 +02:00 committed by Athanasius
parent 8268bfe5da
commit 1733aeae5a

View File

@ -65,7 +65,9 @@ def addcommodities(data):
commodities[key] = new
if len(commodities) > size_pre:
if not len(commodities) > size_pre:
return
if isfile(commodityfile):
__make_backup(commodityfile)
@ -124,7 +126,9 @@ def addmodules(data):
modules[key] = new
if len(modules) > size_pre:
if not len(modules) > size_pre:
return
if isfile(outfile):
__make_backup(outfile)
@ -175,7 +179,8 @@ def addships(data):
ships[key] = new
if len(ships) > size_pre:
if not len(ships) > size_pre:
return
if isfile(shipfile):
__make_backup(shipfile)