Use constant#clear instead of while loop

#clear empties the array in one go, rather than having to loop through every element and pop it off