Skip to content

Fixed the for loop condition and judgment condition of the get_cpu_affinity function#11

Open
zhangyazhou416 wants to merge 1 commit intodavid-macmahon:masterfrom
zhangyazhou416:master
Open

Fixed the for loop condition and judgment condition of the get_cpu_affinity function#11
zhangyazhou416 wants to merge 1 commit intodavid-macmahon:masterfrom
zhangyazhou416:master

Conversation

@zhangyazhou416
Copy link
Copy Markdown

  1. Initialization of mask

mask is initialized to 0, but in later code, if (mask! = 0) This condition is meaningless because mask is always 0. This conditional judgment should be removed.

  1. The loop condition is incorrect

Loop for (i = 31; i <= 0; The condition of i--) is wrong. i <= 0 causes the loop to terminate immediately because the initial value of i is 31, which does not satisfy the condition of i <= 0. i >= 0 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant