I discovered a while back ago while reading the code in MachineScheduler.cpp that there was some duplicated code that was checking resource limits. I experimented with refactoring it, and this is my result. Does it look like an improvement I should commit?
NFC as far as I can see.