mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-08 11:22:10 +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:
parent
8268bfe5da
commit
1733aeae5a
11
collate.py
11
collate.py
@ -65,7 +65,9 @@ def addcommodities(data):
|
|||||||
|
|
||||||
commodities[key] = new
|
commodities[key] = new
|
||||||
|
|
||||||
if len(commodities) > size_pre:
|
if not len(commodities) > size_pre:
|
||||||
|
return
|
||||||
|
|
||||||
if isfile(commodityfile):
|
if isfile(commodityfile):
|
||||||
__make_backup(commodityfile)
|
__make_backup(commodityfile)
|
||||||
|
|
||||||
@ -124,7 +126,9 @@ def addmodules(data):
|
|||||||
|
|
||||||
modules[key] = new
|
modules[key] = new
|
||||||
|
|
||||||
if len(modules) > size_pre:
|
if not len(modules) > size_pre:
|
||||||
|
return
|
||||||
|
|
||||||
if isfile(outfile):
|
if isfile(outfile):
|
||||||
__make_backup(outfile)
|
__make_backup(outfile)
|
||||||
|
|
||||||
@ -175,7 +179,8 @@ def addships(data):
|
|||||||
|
|
||||||
ships[key] = new
|
ships[key] = new
|
||||||
|
|
||||||
if len(ships) > size_pre:
|
if not len(ships) > size_pre:
|
||||||
|
return
|
||||||
|
|
||||||
if isfile(shipfile):
|
if isfile(shipfile):
|
||||||
__make_backup(shipfile)
|
__make_backup(shipfile)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user