I tested the function above.
OP's intention was to create a version of removeAt which modifies the array in-place only when there are no other aliases towards the data. The initial approach was to attempt to check if the passed array is a slice of a larger array, but as it was discussed, it's flawed.
-- Best regards, Vladimir mailto:vladi...@thecybershadow.net