File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -78,17 +78,7 @@ func (es Slice) All() iter.Seq2[int, Value] {
78
78
// CopyTo copies all elements from the current slice overriding the destination.
79
79
func (es Slice ) CopyTo (dest Slice ) {
80
80
dest .getState ().AssertMutable ()
81
- srcLen := es .Len ()
82
- destCap := cap (* dest .getOrig ())
83
- if srcLen <= destCap {
84
- (* dest .getOrig ()) = (* dest .getOrig ())[:srcLen :destCap ]
85
- } else {
86
- (* dest .getOrig ()) = make ([]otlpcommon.AnyValue , srcLen )
87
- }
88
-
89
- for i := range * es .getOrig () {
90
- newValue (& (* es .getOrig ())[i ], es .getState ()).CopyTo (newValue (& (* dest .getOrig ())[i ], dest .getState ()))
91
- }
81
+ * dest .getOrig () = internal .CopyOrigSlice (* dest .getOrig (), * es .getOrig ())
92
82
}
93
83
94
84
// EnsureCapacity is an operation that ensures the slice has at least the specified capacity.
You can’t perform that action at this time.
0 commit comments