File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/libraries/System.Memory/tests/MemoryMarshal Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -107,13 +107,13 @@ public static void ReadOnlySpanGetReferenceAndReadInteger()
107
107
Assert . Equal ( BitConverter . IsLittleEndian ?
108
108
0x65_00_68 :
109
109
0x68_00_65 ,
110
- Unsafe . As < byte , int > ( ref Unsafe . Add ( ref Unsafe . As < char , byte > (
110
+ Unsafe . ReadUnaligned < int > ( ref Unsafe . Add ( ref Unsafe . As < char , byte > (
111
111
ref MemoryMarshal . GetReference ( "hello world 1" . AsSpan ( ) ) ) , 0 ) ) ) ;
112
112
113
113
Assert . Equal ( BitConverter . IsLittleEndian ?
114
114
0x6F_00_6C_00_6C_00_65_00 :
115
- 0x00_65_00_6C_00_6C_00_6F ,
116
- Unsafe . As < byte , long > ( ref Unsafe . Add ( ref Unsafe . As < char , byte > (
115
+ 0x68_00_65_00_6C_00_6C_00 ,
116
+ Unsafe . ReadUnaligned < long > ( ref Unsafe . Add ( ref Unsafe . As < char , byte > (
117
117
ref MemoryMarshal . GetReference ( "hello world 2" . AsSpan ( ) ) ) , 1 ) ) ) ;
118
118
}
119
119
}
You can’t perform that action at this time.
0 commit comments