[Code speedup] - Avoid useless loops