File tree 1 file changed +5
-12
lines changed
1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ package reflect
17
17
18
18
import (
19
19
"internal/goarch"
20
- "internal/unsafeheader"
21
20
"strconv"
22
21
"sync"
23
22
"unicode"
@@ -525,27 +524,21 @@ func writeVarint(buf []byte, n int) int {
525
524
}
526
525
}
527
526
528
- func (n name ) name () ( s string ) {
527
+ func (n name ) name () string {
529
528
if n .bytes == nil {
530
- return
529
+ return ""
531
530
}
532
531
i , l := n .readVarint (1 )
533
- hdr := (* unsafeheader .String )(unsafe .Pointer (& s ))
534
- hdr .Data = unsafe .Pointer (n .data (1 + i , "non-empty string" ))
535
- hdr .Len = l
536
- return
532
+ return unsafe .String (n .data (1 + i , "non-empty string" ), l )
537
533
}
538
534
539
- func (n name ) tag () ( s string ) {
535
+ func (n name ) tag () string {
540
536
if ! n .hasTag () {
541
537
return ""
542
538
}
543
539
i , l := n .readVarint (1 )
544
540
i2 , l2 := n .readVarint (1 + i + l )
545
- hdr := (* unsafeheader .String )(unsafe .Pointer (& s ))
546
- hdr .Data = unsafe .Pointer (n .data (1 + i + l + i2 , "non-empty string" ))
547
- hdr .Len = l2
548
- return
541
+ return unsafe .String (n .data (1 + i + l + i2 , "non-empty string" ), l2 )
549
542
}
550
543
551
544
func (n name ) pkgPath () string {
You can’t perform that action at this time.
0 commit comments