small optimization, thanks to KenanY for spotting it