EXILED icon indicating copy to clipboard operation
EXILED copied to clipboard

Collection extensions upd

Open Banalny-Banan opened this issue 7 months ago • 4 comments

Shuffle<T>(this IEnumerable<T> enumerable, int iterations = 1) - added documentation for thrown exceptions & added an actual shuffle instead of infinite recursive call

AddRange<T>(this IEnumerable<T> enumerable, IEnumerable<T> collection) - before was calling AddItem() in a loop. (multiple Concat()s internaly). It wouldnt even work because AddItem() is a pure method. Now using one Concat().

AddRange<T>(this T[] array, IEnumerable<T> collection) - same changes.

AddRange<T>(this HashSet<T> hashset, IEnumerable<T> collection) - before was calling Add() in a loop. Now using UnionWith().

Banalny-Banan avatar Jun 27 '24 21:06 Banalny-Banan