File tree 6 files changed +6
-5
lines changed
6 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
48
48
### Improvements
49
49
50
50
* (client) [ #21436 ] ( https://github.com/cosmos/cosmos-sdk/pull/21436 ) Use ` address.Codec ` from client.Context in ` tx.Sign ` .
51
+ * (internal) [ #21412 ] ( https://github.com/cosmos/cosmos-sdk/pull/21412 ) Using unsafe.String and unsafe.SliceData.
51
52
52
53
### Bug Fixes
53
54
Original file line number Diff line number Diff line change @@ -15,5 +15,5 @@ func UnsafeStrToBytes(s string) []byte {
15
15
// to be used generally, but for a specific pattern to delete keys
16
16
// from a map.
17
17
func UnsafeBytesToStr (b []byte ) string {
18
- return * ( * string )( unsafe .Pointer ( & b ))
18
+ return unsafe . String ( unsafe .SliceData ( b ), len ( b ))
19
19
}
Original file line number Diff line number Diff line change @@ -15,5 +15,5 @@ func UnsafeStrToBytes(s string) []byte {
15
15
// to be used generally, but for a specific pattern to delete keys
16
16
// from a map.
17
17
func UnsafeBytesToStr (b []byte ) string {
18
- return * ( * string )( unsafe .Pointer ( & b ))
18
+ return unsafe . String ( unsafe .SliceData ( b ), len ( b ))
19
19
}
Original file line number Diff line number Diff line change @@ -15,5 +15,5 @@ func UnsafeStrToBytes(s string) []byte {
15
15
// to be used generally, but for a specific pattern to delete keys
16
16
// from a map.
17
17
func UnsafeBytesToStr (b []byte ) string {
18
- return * ( * string )( unsafe .Pointer ( & b ))
18
+ return unsafe . String ( unsafe .SliceData ( b ), len ( b ))
19
19
}
Original file line number Diff line number Diff line change @@ -13,5 +13,5 @@ func UnsafeStrToBytes(s string) []byte {
13
13
// to be used generally, but for a specific pattern to delete keys
14
14
// from a map.
15
15
func UnsafeBytesToStr (b []byte ) string {
16
- return * ( * string )( unsafe .Pointer ( & b ))
16
+ return unsafe . String ( unsafe .SliceData ( b ), len ( b ))
17
17
}
Original file line number Diff line number Diff line change @@ -15,5 +15,5 @@ func UnsafeStrToBytes(s string) []byte {
15
15
// to be used generally, but for a specific pattern to delete keys
16
16
// from a map.
17
17
func UnsafeBytesToStr (b []byte ) string {
18
- return * ( * string )( unsafe .Pointer ( & b ))
18
+ return unsafe . String ( unsafe .SliceData ( b ), len ( b ))
19
19
}
You can’t perform that action at this time.
0 commit comments