Skip to content

Commit dc15695

Browse files
Remove a double check
1 parent 996696d commit dc15695

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/NHibernate/Async/Cache/ReadWriteCache.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,9 @@ private Task DecrementLockAsync(object key, CacheLock @lock, CancellationToken c
269269
try
270270
{
271271
//decrement the lock
272-
@lock.Unlock(InternalCache.NextTimestamp());
273-
return InternalCache.PutAsync(key, @lock, cancellationToken);
272+
var cache = InternalCache;
273+
@lock.Unlock(cache.NextTimestamp());
274+
return cache.PutAsync(key, @lock, cancellationToken);
274275
}
275276
catch (Exception ex)
276277
{

src/NHibernate/Cache/ReadWriteCache.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,9 @@ public bool Put(CacheKey key, object value, long txTimestamp, object version, IC
344344
private void DecrementLock(object key, CacheLock @lock)
345345
{
346346
//decrement the lock
347-
@lock.Unlock(InternalCache.NextTimestamp());
348-
InternalCache.Put(key, @lock);
347+
var cache = InternalCache;
348+
@lock.Unlock(cache.NextTimestamp());
349+
cache.Put(key, @lock);
349350
}
350351

351352
public void Release(CacheKey key, ISoftLock clientLock)

0 commit comments

Comments
 (0)