Optimize version_compare check, thanks @dongilbert