mirror of
https://github.com/ppy/osu
synced 2024-12-24 15:53:37 +00:00
Move logging and early return into UndeleteForReuse
method itself
This commit is contained in:
parent
6dbfc26158
commit
56427becbb
@ -351,7 +351,6 @@ namespace osu.Game.Stores
|
||||
|
||||
using (var transaction = realm.BeginWrite())
|
||||
{
|
||||
if (existing.DeletePending)
|
||||
UndeleteForReuse(existing);
|
||||
transaction.Commit();
|
||||
}
|
||||
@ -388,12 +387,7 @@ namespace osu.Game.Stores
|
||||
{
|
||||
LogForModel(item, @$"Found existing {HumanisedModelName} for {item} (ID {existing.ID}) – skipping import.");
|
||||
|
||||
if (existing.DeletePending)
|
||||
{
|
||||
LogForModel(item, $@"Existing {HumanisedModelName}'s deletion flag has been removed");
|
||||
UndeleteForReuse(existing);
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
|
||||
return existing.ToLive(Realm);
|
||||
@ -539,6 +533,10 @@ namespace osu.Game.Stores
|
||||
/// <param name="existing">The existing model.</param>
|
||||
protected virtual void UndeleteForReuse(TModel existing)
|
||||
{
|
||||
if (!existing.DeletePending)
|
||||
return;
|
||||
|
||||
LogForModel(existing, $@"Existing {HumanisedModelName}'s deletion flag has been removed to allow for reuse.");
|
||||
existing.DeletePending = false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user