encoding.binary: fix u32 little endian comments (#20256)

This commit is contained in:
Kim Shrier 2023-12-23 06:26:17 -07:00 committed by GitHub
parent 1b6d68187b
commit c7ce72f314
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,7 @@ pub fn little_endian_put_u32(mut b []u8, v u32) {
b[3] = u8(v >> u32(24))
}
// little_endian_put_u32_at writes a u32 to the two bytes in the array b at the specified offset in little endian order.
// little_endian_put_u32_at writes a u32 to the four bytes in the array b at the specified offset in little endian order.
@[direct_array_access; inline]
pub fn little_endian_put_u32_at(mut b []u8, v u32, o int) {
_ = b[o] // bounds check
@ -89,7 +89,7 @@ pub fn little_endian_put_u32_at(mut b []u8, v u32, o int) {
b[o + 3] = u8(v >> u32(24))
}
// little_endian_put_u32_end writes a u32 to the last two bytes in the array b in little endian order.
// little_endian_put_u32_end writes a u32 to the last four bytes in the array b in little endian order.
@[direct_array_access; inline]
pub fn little_endian_put_u32_end(mut b []u8, v u32) {
little_endian_put_u32_at(mut b, v, b.len - 4)