Recently I used a predicate to describe search logic and passed it to the Find method of a few Lists.
foreach (IHiscoreBarItemView item in _view.HiscoreItems)
{
Predicate<Hiscore> matchOfHiscoreName =
(h) => h.Information.Name.Equals(item.HiscoreName);
var current = player.Hiscores.Find(matchOfHiscoreName);
item.GetLogicEngine().ForceSetHiscoreValue(current as Skill);
var goal = player.Goals.Find(matchOfHiscoreName);
item.GetLogicEngine().ForceSetGoalHiscoreValue(goal as Skill);
}
Are there any benefits, apart from 'less code', from using the aforementioned approach over an alternative.
I am particularly interested in performance.
Thanks