Tidy up some missed inspections in RealmContextFactory

This commit is contained in:
Dean Herbert 2021-01-07 15:51:29 +09:00
parent 391259c713
commit 382a40b243
1 changed files with 1 additions and 7 deletions

View File

@ -59,7 +59,6 @@ private void onMigration(Migration migration, ulong oldschemaversion)
private static readonly GlobalStatistic<int> commits = GlobalStatistics.Get<int>("Realm", "Commits");
private static readonly GlobalStatistic<int> rollbacks = GlobalStatistics.Get<int>("Realm", "Rollbacks");
private static readonly GlobalStatistic<int> contexts = GlobalStatistics.Get<int>("Realm", "Contexts");
private Thread writingThread;
/// <summary>
/// Get a context for the current thread for read-only usage.
@ -86,11 +85,7 @@ public RealmWriteUsage GetForWrite()
{
context = getContextForCurrentThread();
if (currentWriteTransaction == null)
{
writingThread = Thread.CurrentThread;
currentWriteTransaction = context.BeginWrite();
}
currentWriteTransaction ??= context.BeginWrite();
}
catch
{
@ -144,7 +139,6 @@ private void usageCompleted(RealmWriteUsage usage)
}
currentWriteTransaction = null;
writingThread = null;
rollbackRequired = false;
refreshCompleted = new ThreadLocal<bool>();