Maybe I'm missing something, but it doesn't look like this function modifies the geometry at all, it always creates a new array of geometry instances, or returns an array size 1 of the passed in geometry, unmodified.