Avoid method call in for condition