Created by: yonivy
The priorities did not worked correctly.
- The strategy function received the wrong index so the number of jobs to process did the opposite of what it needs to do (0 for 'critical', 1 for 'high' etc.).
- Reversing the queues array messed a lot. Array.prototype.reverse() is done in place so we're reversing it on each call, not to mention the other possible side effects that may happen from mutating the original array (didn't test other stuff, but it seems like a bug waiting to happen).
Note The second commit is just to fix some indentation mishaps. I'm working with emacs but I switched to sublime text and installed EditorConfig to prevent any harm.