Reply to thread

this is potentially an expensive call:


[code]

 try

+          {

+            tuningDetails = d[channel.IdChannel];

+          }

+          catch (KeyNotFoundException)

+          {

+            tuningDetails = new List<TuningDetail>();

+          }

[/code]


use .TryGetValue whenever possible for performance.


[code]

IList<TuningDetail> tuningDetails;

if (!d.TryGetValue(channel.IdChannel, out tuningDetails) )

{

   tuningDetails = new List<TuningDetail>();

}

[/code]


/gibman


Top Bottom