Hi guys,

I have a dictionary(of someType, someOtherType) (the types are immaterial). With a given value, I need to find all the keys that have that value in the dictionary. What I am currently doing is this:
Code:
Dim foundList as New List(of someType)
For each key as someType in myDictionary.Keys
    If myDictionary(key) = givenValue Then
       foundList.Add(key)
    End If
Next
Although it works, I have a strong feeling that it's not optimized (I have to loop thru the whole dictionary.keys collection).
Is there a better way doing it (because I'm targeting .Net 2.0, no LINQ please...)?

Thanks for reading,
Stanav.