P
Phil Sandler
All,
I have a situation where I need a List<string> that performs like a
generic dictionary (Dictionary<string, string>). Essentially, I just
need the key, not the value, so I want to use as little memory as
possible. Currently I am setting all the values of the dictionary to
null.
The List<string> doesn't work because I am doing a lot of .Contains()
or .ContainsKey(), and lookup speed is pretty critical.
So, does such a thing exist? A dictionary that only uses a key, with
no value? Or does making the value null eliminate any memory overhead
anyway?
Thanks for any insight.
Phil
I have a situation where I need a List<string> that performs like a
generic dictionary (Dictionary<string, string>). Essentially, I just
need the key, not the value, so I want to use as little memory as
possible. Currently I am setting all the values of the dictionary to
null.
The List<string> doesn't work because I am doing a lot of .Contains()
or .ContainsKey(), and lookup speed is pretty critical.
So, does such a thing exist? A dictionary that only uses a key, with
no value? Or does making the value null eliminate any memory overhead
anyway?
Thanks for any insight.
Phil