Skip to content

Commit 28002e5

Browse files
bitfasterAlex Peck
andauthored
rem braces (#385)
* rem braces * rem braces * excl builder * rem exlc --------- Co-authored-by: Alex Peck <alexpeck@microsoft.com>
1 parent 6155e26 commit 28002e5

22 files changed

+3
-77
lines changed

BitFaster.Caching/Atomic/AtomicFactoryAsyncCache.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ public sealed class AtomicFactoryAsyncCache<K, V> : IAsyncCache<K, V>
2626
public AtomicFactoryAsyncCache(ICache<K, AsyncAtomicFactory<K, V>> cache)
2727
{
2828
if (cache == null)
29-
{
3029
Throw.ArgNull(ExceptionArgument.cache);
31-
}
3230

3331
this.cache = cache;
3432

BitFaster.Caching/Atomic/AtomicFactoryCache.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ public sealed class AtomicFactoryCache<K, V> : ICache<K, V>
2424
public AtomicFactoryCache(ICache<K, AtomicFactory<K, V>> cache)
2525
{
2626
if (cache == null)
27-
{
2827
Throw.ArgNull(ExceptionArgument.cache);
29-
}
3028

3129
this.cache = cache;
3230

BitFaster.Caching/Atomic/AtomicFactoryScopedAsyncCache.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ public sealed class AtomicFactoryScopedAsyncCache<K, V> : IScopedAsyncCache<K, V
2626
public AtomicFactoryScopedAsyncCache(ICache<K, ScopedAsyncAtomicFactory<K, V>> cache)
2727
{
2828
if (cache == null)
29-
{
3029
Throw.ArgNull(ExceptionArgument.cache);
31-
}
3230

3331
this.cache = cache;
3432
if (cache.Events.HasValue)
@@ -106,9 +104,7 @@ private async ValueTask<Lifetime<V>> ScopedGetOrAddAsync<TFactory>(K key, TFacto
106104
spinwait.SpinOnce();
107105

108106
if (c++ > ScopedCacheDefaults.MaxRetry)
109-
{
110107
Throw.ScopedRetryFailure();
111-
}
112108
}
113109
}
114110

BitFaster.Caching/Atomic/AtomicFactoryScopedCache.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ public sealed class AtomicFactoryScopedCache<K, V> : IScopedCache<K, V> where V
2525
public AtomicFactoryScopedCache(ICache<K, ScopedAtomicFactory<K, V>> cache)
2626
{
2727
if (cache == null)
28-
{
2928
Throw.ArgNull(ExceptionArgument.cache);
30-
}
3129

3230
this.cache = cache;
3331

@@ -106,9 +104,7 @@ private Lifetime<V> ScopedGetOrAdd<TFactory>(K key, TFactory valueFactory) where
106104
spinwait.SpinOnce();
107105

108106
if (c++ > ScopedCacheDefaults.MaxRetry)
109-
{
110107
Throw.ScopedRetryFailure();
111-
}
112108
}
113109
}
114110

BitFaster.Caching/Buffers/MpmcBoundedBuffer.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ public sealed class MpmcBoundedBuffer<T>
2424
public MpmcBoundedBuffer(int boundedLength)
2525
{
2626
if (boundedLength < 0)
27-
{
2827
Throw.ArgOutOfRange(nameof(boundedLength));
29-
}
3028

3129
// must be power of 2 to use & slotsMask instead of %
3230
boundedLength = BitOps.CeilingPowerOfTwo(boundedLength);

BitFaster.Caching/Buffers/MpscBoundedBuffer.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ public sealed class MpscBoundedBuffer<T> where T : class
2626
public MpscBoundedBuffer(int boundedLength)
2727
{
2828
if (boundedLength < 0)
29-
{
3029
Throw.ArgOutOfRange(nameof(boundedLength));
31-
}
3230

3331
// must be power of 2 to use & slotsMask instead of %
3432
boundedLength = BitOps.CeilingPowerOfTwo(boundedLength);

BitFaster.Caching/CacheDebugView.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ internal class CacheDebugView<K, V>
1212
public CacheDebugView(ICache<K, V> cache)
1313
{
1414
if (cache is null)
15-
{
1615
Throw.ArgNull(ExceptionArgument.cache);
17-
}
1816

1917
this.cache = cache;
2018
}

BitFaster.Caching/Lfu/LfuCapacityPartition.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ private double Clamp(double input, double min, double max)
121121
private static (int window, int mainProtected, int mainProbation) ComputeQueueCapacity(int capacity, double mainPercentage)
122122
{
123123
if (capacity < 3)
124-
{
125124
Throw.ArgOutOfRange(nameof(capacity), "Capacity must be greater than or equal to 3.");
126-
}
127125

128126
int window = capacity - (int)(mainPercentage * capacity);
129127
int mainProtected = (int)(0.8 * (capacity - window));

BitFaster.Caching/Lfu/LfuNodeList.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,20 @@ IEnumerator IEnumerable.GetEnumerator()
124124
internal static void ValidateNewNode(LfuNode<K, V> node)
125125
{
126126
if (node == null)
127-
{
128127
Throw.ArgNull(ExceptionArgument.node);
129-
}
130128

131129
if (node.list != null)
132-
{
133130
Throw.InvalidOp("Node is already attached to a list.");
134-
}
135131
}
136132

137133
[ExcludeFromCodeCoverage]
138134
internal void ValidateNode(LfuNode<K, V> node)
139135
{
140136
if (node == null)
141-
{
142137
Throw.ArgNull(ExceptionArgument.node);
143-
}
144138

145139
if (node.list != this)
146-
{
147140
Throw.InvalidOp("Node is already attached to a different list.");
148-
}
149141
}
150142
#endif
151143

@@ -172,9 +164,7 @@ object IEnumerator.Current
172164
get
173165
{
174166
if (index == 0 || (index == list.Count + 1))
175-
{
176167
Throw.InvalidOp("Out of bounds");
177-
}
178168

179169
return Current;
180170
}

BitFaster.Caching/Lru/CapacityPartitionExtensions.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@ public static class CapacityPartitionExtensions
1515
public static void Validate(this ICapacityPartition capacity)
1616
{
1717
if (capacity.Cold < 1)
18-
{
1918
Throw.ArgOutOfRange(nameof(capacity.Cold));
20-
}
2119

2220
if (capacity.Warm < 1)
23-
{
2421
Throw.ArgOutOfRange(nameof(capacity.Warm));
25-
}
2622

2723
if (capacity.Hot < 1)
28-
{
2924
Throw.ArgOutOfRange(nameof(capacity.Hot));
30-
}
3125
}
3226
}
3327
}

0 commit comments

Comments
 (0)