Fix a likely copy-paste error. Slightly improves performance.

I'm pretty sure you meant to have this check done in the outer loop, not the inner loop. listImplementedInterfaces() has it in the inner loop, because what you loop over is swapped.