Small performance enhancement to renderLoop().