mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[core] Avoid unnecessary disk writes when assets didn't change
This commit is contained in:
parent
6fb6bb14a4
commit
2adc0b1a3e
|
@ -335,7 +335,7 @@ class LegendaryCore:
|
|||
return []
|
||||
|
||||
if self.lgd.assets:
|
||||
assets = self.lgd.assets
|
||||
assets = self.lgd.assets.copy()
|
||||
else:
|
||||
assets = dict()
|
||||
|
||||
|
@ -346,6 +346,8 @@ class LegendaryCore:
|
|||
]
|
||||
})
|
||||
|
||||
# only save (and write to disk) if there were changes
|
||||
if self.lgd.assets != assets:
|
||||
self.lgd.assets = assets
|
||||
|
||||
return self.lgd.assets[platform]
|
||||
|
|
Loading…
Reference in a new issue