KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Are enum types faster/more efficient than string types when used as dictionary keys? IDictionary<string,object> or IDictionary<enum,object> As a matter of fact, which data type is most suitable as a dictionary key and why? Consider the following: NOTE: Only 5 properties for simplicity struct MyKeys { public string Incomplete = "IN"; public string Submitted = "SU"; public string Processing="PR"; public string Completed = "CO"; public string Closed = "CL"; } and enum MyKeys { Incomplete, Submitted, Processing, Completed, Closed } Which of the above will be better if used as keys in a dictionary!
Tags (comma-separated)
Save Edits
Cancel