Small performance optimization

as suggested by Petr van Blokland, thanks!