static public void FromVtArray(VtTokenArray input, ref string[] output) { if (output.Length != input.size()) { output = UsdIo.ArrayAllocator.Malloc <string>(input.size()); } // PERFORMANCE: this is super inefficient. for (int i = 0; i < input.size(); i++) { output[i] = input[i]; } }
// Convenience API: generates garbage, do not use when performance matters. static public string[] FromVtArray(VtTokenArray input) { var output = UsdIo.ArrayAllocator.Malloc <string>(input.size()); FromVtArray(input, ref output); return(output); }