From 2b7e3e60944e65de2e9c816e6bcfd58bd79b1681 Mon Sep 17 00:00:00 2001 From: dadhi Date: Mon, 25 Jul 2022 10:40:11 +0200 Subject: [PATCH] fix spelling in comments --- .vscode/settings.json | 3 +++ src/ImTools/ImTools.cs | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 646f4d0..e906189 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,9 @@ { "cSpell.words": [ "cref", + "Hasher", + "langword", + "prepended", "rebalance", "skipci" ], diff --git a/src/ImTools/ImTools.cs b/src/ImTools/ImTools.cs index 3291eaa..0586c88 100644 --- a/src/ImTools/ImTools.cs +++ b/src/ImTools/ImTools.cs @@ -237,7 +237,7 @@ public static T[] Copy(this T[] source) return copy; } - /// Array copy without checking the items for the null or the emptyness + /// Array copy without checking the items for the null or the emptiness [MethodImpl((MethodImplOptions)256)] public static T[] CopyNonEmpty(this T[] source) { @@ -2106,7 +2106,7 @@ internal virtual StringBuilder ToMermaidString(StringBuilder s) => /// If hash does not match the method returns `null` internal virtual Entry GetEntryOrNull(int hash) => null; - /// Assumes the hash is present in the map (because the map is immutable if we know the hash is present then it cannote disappear) + /// Assumes the hash is present in the map (because the map is immutable if we know the hash is present then it cannot disappear) /// otherwise the result. Returns the Entry with the `hash` though it may be a `HashConflictingEntry` internal virtual Entry GetSurePresentEntry(int hash) => throw new InvalidOperationException("The sure present hash does not exist in the empty map"); @@ -6053,20 +6053,20 @@ public static ImHashMap Remove(this ImHashMap map, K key) => } /// - /// The fixed array of maps (partitions) where the key first (lower) bits are used to locate the partion to lookup into. + /// The fixed array of maps (partitions) where the key first (lower) bits are used to locate the partition to lookup into. /// Note: The partition array is NOT immutable and operates by swapping the updated partition with the new one. /// The number of partitions may be specified by user or you can use the default number 16. /// The default number 16 was selected to be not so big to pay for the few items and not so small to diminish the use of partitions. /// public static class PartitionedHashMap { - /// The default number of partions + /// The default number of partitions public const int PARTITION_COUNT_POWER_OF_TWO = 16; /// The default mask to partition the key public const int PARTITION_HASH_MASK = PARTITION_COUNT_POWER_OF_TWO - 1; - /// Creates the new collection with the empty partions + /// Creates the new collection with the empty partitions [MethodImpl((MethodImplOptions)256)] public static ImHashMap[] CreateEmpty(int partitionCountOfPowerOfTwo = PARTITION_COUNT_POWER_OF_TWO) { @@ -6076,7 +6076,7 @@ public static ImHashMap[] CreateEmpty(int partitionCountOfPowerOfTwo return parts; } - /// Creates the new collection with the empty partions + /// Creates the new collection with the empty partitions [MethodImpl((MethodImplOptions)256)] public static ImHashMap[] CreateEmpty(int partitionCountOfPowerOfTwo = PARTITION_COUNT_POWER_OF_TWO) { @@ -6170,7 +6170,7 @@ public static bool TryFindByReferenceEquals(this ImHashMap[] parts, int partHashMask = PARTITION_HASH_MASK) where K : class => parts.TryFindByReferenceEquals(key.GetHashCode(), key, out value, partHashMask); - /// Returns the SAME partitioned maps array instance but with the NEW added or updated partion + /// Returns the SAME partitioned maps array instance but with the NEW added or updated partition [MethodImpl((MethodImplOptions)256)] public static void AddOrUpdate(this ImHashMap[] parts, int hash, V value, int partHashMask = PARTITION_HASH_MASK) { @@ -6183,7 +6183,7 @@ public static void AddOrUpdate(this ImHashMap[] parts, int hash, V va private static void RefAddOrUpdatePart(ref ImHashMap part, int hash, V value) => Ref.Swap(ref part, hash, value, (x, h, v) => x.AddOrUpdate(h, v)); - /// Returns the SAME partitioned maps array instance but with the NEW added or updated partion + /// Returns the SAME partitioned maps array instance but with the NEW added or updated partition [MethodImpl((MethodImplOptions)256)] public static void AddOrUpdate(this ImHashMap[] parts, int hash, K key, V value, int partHashMask = PARTITION_HASH_MASK) { @@ -6193,7 +6193,7 @@ public static void AddOrUpdate(this ImHashMap[] parts, int hash, K k RefAddOrUpdatePart(ref part, hash, key, value); } - /// Returns the SAME partitioned maps array instance but with the NEW added or updated partion + /// Returns the SAME partitioned maps array instance but with the NEW added or updated partition [MethodImpl((MethodImplOptions)256)] public static void AddOrUpdate(this ImHashMap[] parts, K key, V value, int partHashMask = PARTITION_HASH_MASK) => parts.AddOrUpdate(key.GetHashCode(), key, value, partHashMask); @@ -6201,7 +6201,7 @@ public static void AddOrUpdate(this ImHashMap[] parts, K key, V valu private static void RefAddOrUpdatePart(ref ImHashMap part, int hash, K key, V value) => Ref.Swap(ref part, hash, key, value, (x, h, k, v) => x.AddOrUpdate(h, k, v)); - /// Returns the SAME partitioned maps array instance but with the NEW added or updated partion + /// Returns the SAME partitioned maps array instance but with the NEW added or updated partition [MethodImpl((MethodImplOptions)256)] public static void AddOrUpdate(this ImHashMap[] parts, int hash, V value, Update update, int partHashMask = PARTITION_HASH_MASK) { @@ -6211,7 +6211,7 @@ public static void AddOrUpdate(this ImHashMap[] parts, int hash, V va Ref.Swap(ref part, hash, value, update, (x, h, k, u) => x.AddOrUpdate(h, k, u)); } - /// Returns the SAME partitioned maps array instance but with the NEW added or updated partion + /// Returns the SAME partitioned maps array instance but with the NEW added or updated partition [MethodImpl((MethodImplOptions)256)] public static void AddOrUpdate(this ImHashMap[] parts, int hash, K key, V value, Update update, int partHashMask = PARTITION_HASH_MASK) { @@ -6221,12 +6221,12 @@ public static void AddOrUpdate(this ImHashMap[] parts, int hash, K k Ref.Swap(ref part, hash, key, value, update, (x, h, k, v, u) => x.AddOrUpdate(h, k, v, u)); } - /// Returns the SAME partitioned maps array instance but with the NEW added or updated partion + /// Returns the SAME partitioned maps array instance but with the NEW added or updated partition [MethodImpl((MethodImplOptions)256)] public static void AddOrUpdate(this ImHashMap[] parts, K key, V value, Update update, int partHashMask = PARTITION_HASH_MASK) => parts.AddOrUpdate(key.GetHashCode(), key, value, update); - /// Returns the SAME partitioned maps array instance but with the NEW added or the same kept partion + /// Returns the SAME partitioned maps array instance but with the NEW added or the same kept partition [MethodImpl((MethodImplOptions)256)] public static void AddOrKeep(this ImHashMap[] parts, int hash, V value, int partHashMask = PARTITION_HASH_MASK) { @@ -6239,7 +6239,7 @@ public static void AddOrKeep(this ImHashMap[] parts, int hash, V valu private static void RefAddOrKeepPart(ref ImHashMap part, int hash, V value) => Ref.Swap(ref part, hash, value, (x, h, v) => x.AddOrUpdate(h, v)); - /// Returns the SAME partitioned maps array instance but with the NEW added or the same kept partion + /// Returns the SAME partitioned maps array instance but with the NEW added or the same kept partition [MethodImpl((MethodImplOptions)256)] public static void AddOrKeep(this ImHashMap[] parts, int hash, K key, V value, int partHashMask = PARTITION_HASH_MASK) {