Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Bjarke Berg <[email protected]>
  • Loading branch information
nikolajlauridsen and bergmania authored Mar 9, 2021
1 parent 6898fd2 commit b554aa9
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/Umbraco.Core/Scoping/Scope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,14 @@ private void IncrementRequestedReadLock(params int[] lockIds)
{
lock (_dictionaryLocker)
{
if (!ReadLocks.ContainsKey(lockId))
if (ReadLocks.ContainsKey(lockId))
{
ReadLocks[lockId] = 0;
ReadLocks[lockId] += 1;
}
else
{
ReadLocks[lockId] = 1;
}

ReadLocks[lockId] += 1;
}
}
}
Expand All @@ -598,12 +600,14 @@ private void IncrementRequestedWriteLock(params int[] lockIds)
{
lock (_dictionaryLocker)
{
if (!WriteLocks.ContainsKey(lockId))
if (WriteLocks.ContainsKey(lockId))
{
WriteLocks[lockId] = 0;
WriteLocks[lockId] = 1;
}
else
{
WriteLocks[lockId] += 1;
}

WriteLocks[lockId] += 1;
}
}
}
Expand Down

0 comments on commit b554aa9

Please sign in to comment.