泛型swap和泛型indexOf