typhon icon indicating copy to clipboard operation
typhon copied to clipboard

Refactor errors

Open zemanlx opened this issue 5 years ago • 0 comments

I was looking at the codebase and thinking if I can make some part a bit nicer. Here is my first attempt.

I have:

  • added unit tests for ErrorFilter function to lock behaviour and be sure later that I am not changing it.
  • removed dead code
  • refactored ErrorFilter function to
    • return early
    • avoid else as much as possible
    • not duplicate work
    • decrease number of indented code
    • decrease brain buffer when reading code flow

I can do more PRs like this one if you find it useful.

zemanlx avatar Oct 10 '19 14:10 zemanlx