Do you need to modify this list? It looks like it's not used after this line. It also seems weird to modify an array that the user passed in, even if we control the array.