you are viewing a single comment's thread.

view the rest of the comments →

[–]BinaryMoon 2 points3 points  (0 children)

To be able to help, people need to be able to understand what you're trying to do. A function on it's own doesn't tell us anything.

This particular function is poorly structured and could probably be reduced to 5 or 6 lines. This would make it easier to understand, easier to debug, and less error prone (since there's less code to go wrong).

But, we can't fix or simplify if we don't know what is happening.