Showing the changes to git-bitmap/src (1 of 58 files). Show all
Unified · Split
| @@ -21,7 +21,7 @@ pub fn decode(data: &[u8]) -> Result<(Vec, &[u8]), decode::Error> { · 20 unmodified lines | |||
| 21 | let (len, data) = decode::u32(data).ok_or(Error::Corrupt("eof reading chunk length"))?; | 21 | let (len, data) = decode::u32(data).ok_or(Error::Corrupt("eof reading chunk length"))?; |
| 22 | let len = len as usize; | 22 | let len = len as usize; |
| 23 | 23 | ||
| 24 | // NOTE: git does this by copying all bytes first, and then it will change the endianess in a separate loop. | 24 | // NOTE: git does this by copying all bytes first, and then it will change the endianness in a separate loop. |
| 25 | // Maybe it's faster, but we can't do it without unsafe. Let's leave it to the optimizer and maybe | 25 | // Maybe it's faster, but we can't do it without unsafe. Let's leave it to the optimizer and maybe |
| 26 | // one day somebody will find out that it's worth it to use unsafe here. | 26 | // one day somebody will find out that it's worth it to use unsafe here. |
| 27 | let (mut bits, data) = decode::split_at_pos(data, len * std::mem::size_of::<u64>()) | 27 | let (mut bits, data) = decode::split_at_pos(data, len * std::mem::size_of::<u64>()) |