Judes
Judes
CC#
Created by i like chatgpt on 2/5/2024 in #help
✅ Can my Equals(IEnumerable<T>? x, IEnumerable<T>? y) be made much simpler?
absolutely disgusting but:
return (x, y) is (not null, not null) && x.SequenceEqual(y);
return (x, y) is (not null, not null) && x.SequenceEqual(y);
6 replies
CC#
Created by reinaldyrfl on 1/22/2024 in #help
✅ Growing memory issues for ASP.NET Core App
30 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
Look up YAGNI on Google.
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
you're not using it for anything, so you can just query the hashset.
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
you don't need to know the index of anything.
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
you won't need one.
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
you should be fine using a hashset
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
although this behavior is not documented
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
IIRC, the hash set implementation of c# maintains ordering of the elements inserted.
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
Well, to answer your question: the most appropriate data type here appears to be HashSet<Clip> instead of List<Clip>, since it guarantees uniqueness of elements, ordering doesn't matter, and all read/write operations are O(1). (That said, this whole project is overwhelmingly overengineered, and if I'm being honest performance is the absolute last thing you should be worrying about here.)
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
I see.
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
Is there an implicit conversion between Clip and ClipViewModel?
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
Are you sure this GetClipByModel compiles?
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
You're just iterating the list.
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
Still seems like you're not using any indexes here.
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
Still I see no usage of the index.
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
Do you have an example of that happening?
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
It seems to me you don't really need to know the index of a given element of the list. Instead you wish to only know whether that element in present in the list, is that right?
65 replies
CC#
Created by br4kejet on 10/22/2023 in #help
❔ Best way to cache index of an object in a list
Yes, that would help.
65 replies