51

Working on code that we took from other devices company. We found this brilliant thing in one of their function (check catch blok)

Comments
  • 1
    @WDGaster no judgement, couple of improvements.

    Replace the foreach with a Linq call:

    pcl.Any(p => p.ProcessName.Contains(...))

    Will return a bool you can just assign.

    The catch block doesn’t need (exception) if you’re just swallowing it, if can just be catch {}.

    👍
Add Comment