Skip to content

Commit

Permalink
optim merform
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov authored and NikolayPianikov committed Jul 14, 2018
1 parent b852fce commit 228deca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions IoC.Source/IoC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6869,7 +6869,7 @@ private Table(Table<TKey, TValue> origin, int hashCode, TKey key, TValue value)
Count = origin.Count + 1;
if (origin.Count > origin._divisor)
{
_divisor = (origin._divisor + 1) << 1 - 1;
_divisor = (origin._divisor + 1) << 2 - 1;
_buckets = CollectionExtensions.CreateArray(_divisor + 1, Bucket.EmptyBucket);
var originBuckets = origin._buckets;
for (var originBucketIndex = 0; originBucketIndex < originBuckets.Length; originBucketIndex++)
Expand Down Expand Up @@ -6962,7 +6962,7 @@ public Table<TKey, TValue> Remove(int hashCode, TKey key, out bool removed)
return new Table<TKey, TValue>(newBuckets, _divisor, removed ? Count - 1: Count);
}

internal sealed class KeyValue
internal struct KeyValue
{
public readonly int HashCode;
public readonly TKey Key;
Expand Down
4 changes: 2 additions & 2 deletions IoC/Core/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private Table(Table<TKey, TValue> origin, int hashCode, TKey key, TValue value)
Count = origin.Count + 1;
if (origin.Count > origin._divisor)
{
_divisor = (origin._divisor + 1) << 1 - 1;
_divisor = (origin._divisor + 1) << 2 - 1;
_buckets = CollectionExtensions.CreateArray(_divisor + 1, Bucket.EmptyBucket);
var originBuckets = origin._buckets;
for (var originBucketIndex = 0; originBucketIndex < originBuckets.Length; originBucketIndex++)
Expand Down Expand Up @@ -121,7 +121,7 @@ public Table<TKey, TValue> Remove(int hashCode, TKey key, out bool removed)
return new Table<TKey, TValue>(newBuckets, _divisor, removed ? Count - 1: Count);
}

internal sealed class KeyValue
internal struct KeyValue
{
public readonly int HashCode;
public readonly TKey Key;
Expand Down

0 comments on commit 228deca

Please sign in to comment.