ikalou.
ikalou.
CC#
Created by ikalou. on 7/26/2024 in #help
List, Collection Initializer and Capacity
Hi! Does creating a new List with new List<T> { new T() } (or any number of elements > 0) starts with the proper capacity in order to avoid resizes or does it start at 0 and then grows to add the elements and I should be using new List<T>(1) { new T() } (for instance) instead? Thanks for helping me figure this out!
54 replies
CC#
Created by ikalou. on 2/27/2024 in #help
Compression with real time compressed size estimation
Hi all. Is there a something I can use to compress a stream of data while getting a good estimate of the compressed size as I feed data into it? I doesn't have to be state of the art. I was thinking of maybe using something very simple like LZW but there aren't many good libraries or resources for it as it's not very popular nowadays.
3 replies
CC#
Created by ikalou. on 2/8/2024 in #help
Casting from int to uint and back
Is casting a negative int to a uint and then back to a int guaranteed to give back the original negative value on all platforms, architectures and runtimes? Thanks!
11 replies