I just add another if statement and the result came up slowly

i just add few coding and it made it slower