Normal
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
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.
IList<TuningDetail> tuningDetails;
if (!d.TryGetValue(channel.IdChannel, out tuningDetails) )
{
tuningDetails = new List<TuningDetail>();
}
/gibman