Skip to content

Commit bb2f7e3

Browse files
refactor: remove unused ChunkArray method
- Remove ChunkArray<T> method (not used anywhere) - Keep ChunkList<T> which is actively used by BatchCheck Addresses feedback from PR #150
1 parent a506326 commit bb2f7e3

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/OpenFga.Sdk/Client/Utils/ClientUtils.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,6 @@ public static string GenerateCorrelationId() {
1717
return Guid.NewGuid().ToString();
1818
}
1919

20-
/// <summary>
21-
/// Chunks an array into smaller batches of a specified size
22-
/// </summary>
23-
/// <typeparam name="T">Type of items in the array</typeparam>
24-
/// <param name="source">Source array to chunk</param>
25-
/// <param name="chunkSize">Maximum size of each chunk</param>
26-
/// <returns>Enumerable of arrays, each containing up to chunkSize elements</returns>
27-
public static IEnumerable<T[]> ChunkArray<T>(T[] source, int chunkSize) {
28-
if (source == null) throw new ArgumentNullException(nameof(source));
29-
if (chunkSize <= 0) throw new ArgumentException("Chunk size must be greater than 0", nameof(chunkSize));
30-
31-
for (int i = 0; i < source.Length; i += chunkSize) {
32-
int actualChunkSize = Math.Min(chunkSize, source.Length - i);
33-
T[] chunk = new T[actualChunkSize];
34-
Array.Copy(source, i, chunk, 0, actualChunkSize);
35-
yield return chunk;
36-
}
37-
}
38-
3920
/// <summary>
4021
/// Chunks a list into smaller batches of a specified size
4122
/// </summary>

0 commit comments

Comments
 (0)