Deduplicate string instances
问题 I have array of nearly 1,000,000 records, each record has a field "filename". There are many records with exactly the same filename. My goal is to improve memory footprint by deduplicating string instances (filename instances, not records). .NET Framework 2.0 is a constraint. no LINQ here. I wrote a generic (and thread-safe) class for the deduplication: public class Deduplication<T> where T : class { private static Deduplication<T> _global = new Deduplication<T>(); public static Deduplication