Skip to content

Commit 1d71420

Browse files
authored
Update dir.rs
1 parent d680667 commit 1d71420

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/dir.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,8 @@ pub const unsafe fn dirent_const_time_strlen(dirent: *const libc::dirent64) -> u
385385
// the non-name bytes (d_type and padding) to avoid false null detection.
386386
// The 0x00FF_FFFF mask preserves only the 3 bytes where the name could start.
387387
// Branchless masking: avoids branching by using a mask that is either 0 or 0x00FF_FFFF
388-
unsafe{std::hint::assert_unchecked(reclen % 8 ==0 && reclen >=24 )}; //tell the compiler is a multiple of 8 and within bounds
389-
//this is safe because the kernel guarantees the above.
390388
//............................//special case short name check
391-
let mask = 0x00FF_FFFFu64 * ((reclen ==24) as u64); // (multiply by 0 or 1)
389+
let mask = 0x00FF_FFFFu64 * ((reclen ==24) as u64); // (multiply by 0 or 1)
392390
// The mask is applied to the last word to isolate the relevant bytes.
393391
// The last word is masked to isolate the relevant bytes,
394392
//we're bit manipulating the last word (a byte/u64) to find the first null byte

0 commit comments

Comments
 (0)