mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:42:58 +08:00
Fix RealmLive
unnecessarily passing ID around
Appears to have never been needed. When the `retrieveFromID` method was
created in 81b5717ae7
, it didn't use the
`id` parameter for anything either.
This commit is contained in:
parent
3d7af805a3
commit
a378e78ced
@ -63,7 +63,7 @@ namespace osu.Game.Database
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
perform(retrieveFromID(r, ID));
|
perform(retrieveFromID(r));
|
||||||
RealmLiveStatistics.USAGE_ASYNC.Value++;
|
RealmLiveStatistics.USAGE_ASYNC.Value++;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
return realm.Run(r =>
|
return realm.Run(r =>
|
||||||
{
|
{
|
||||||
var returnData = perform(retrieveFromID(r, ID));
|
var returnData = perform(retrieveFromID(r));
|
||||||
RealmLiveStatistics.USAGE_ASYNC.Value++;
|
RealmLiveStatistics.USAGE_ASYNC.Value++;
|
||||||
|
|
||||||
if (returnData is RealmObjectBase realmObject && realmObject.IsManaged)
|
if (returnData is RealmObjectBase realmObject && realmObject.IsManaged)
|
||||||
@ -139,11 +139,11 @@ namespace osu.Game.Database
|
|||||||
}
|
}
|
||||||
|
|
||||||
dataIsFromUpdateThread = true;
|
dataIsFromUpdateThread = true;
|
||||||
data = retrieveFromID(realm.Realm, ID);
|
data = retrieveFromID(realm.Realm);
|
||||||
RealmLiveStatistics.USAGE_UPDATE_REFETCH.Value++;
|
RealmLiveStatistics.USAGE_UPDATE_REFETCH.Value++;
|
||||||
}
|
}
|
||||||
|
|
||||||
private T retrieveFromID(Realm realm, Guid id)
|
private T retrieveFromID(Realm realm)
|
||||||
{
|
{
|
||||||
var found = realm.Find<T>(ID);
|
var found = realm.Find<T>(ID);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user