Small optimization when preventing collisions of short codes