Skip to content

Commit ce04db3

Browse files
committed
Reorder the condition for checking if batching is supported in order to reduce type checking.
1 parent fae4917 commit ce04db3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NHibernate/Cache/ICacheConcurrencyStrategy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ public static bool[] PutMany(this ICacheConcurrencyStrategy cache, CacheKey[] ke
185185
public static bool IsBatchingGetSupported(this ICacheConcurrencyStrategy cache)
186186
{
187187
// ReSharper disable once SuspiciousTypeConversion.Global
188-
return cache is IBatchableCacheConcurrencyStrategy && cache.Cache is IBatchableReadOnlyCache;
188+
return cache.Cache is IBatchableReadOnlyCache && cache is IBatchableCacheConcurrencyStrategy;
189189
}
190190

191191
public static bool IsBatchingPutSupported(this ICacheConcurrencyStrategy cache)
192192
{
193193
// ReSharper disable once SuspiciousTypeConversion.Global
194-
return cache is IBatchableCacheConcurrencyStrategy && cache.Cache is IBatchableCache;
194+
return cache.Cache is IBatchableCache && cache is IBatchableCacheConcurrencyStrategy;
195195
}
196196
}
197197
}

0 commit comments

Comments
 (0)