Skip to content

Commit

Permalink
std library unix/thread.rs: use the actual type for the loop variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
he32 committed Mar 25, 2024
1 parent dba2e20 commit 60628eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/sys/pal/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
if !set.is_null() {
let mut count: usize = 0;
if libc::pthread_getaffinity_np(libc::pthread_self(), libc::_cpuset_size(set), set) == 0 {
for i in 0..u32::MAX {
match libc::_cpuset_isset(i.into(), set) {
for i in 0..libc::cpuid_t::MAX {
match libc::_cpuset_isset(i, set) {
-1 => break,
0 => continue,
_ => count = count + 1,
Expand Down

0 comments on commit 60628eb

Please sign in to comment.