Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
除了第一个只处理数组的明显区别之外,它们不做同样的事情吗?我一直在阅读这两个功能的帮助页面,不明白什么时候应该使用其中一个以及为什么。互联网搜索似乎表明,如果不使用循环编写,则仅将第二个用于数组复制目的。
System.Copy真的是编译器的魔法。它适用于字符串和动态数组。
System.Copy
编译器选择所需版本的内在例程(短字符串、长字符串、动态数组不同)并替换您对Copy.
Copy
动态数组 _DynArrayCopyRange准备内存,提供引用计数,并调用System.CopyArray元素的深拷贝。
_DynArrayCopyRange
System.CopyArray
通常你不需要显式调用最后一个过程,这是编译器的特权。