Skip to content

Refactor: used the init-statement to declare "pos" inside the if statement #3214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gberkes
Copy link
Contributor

@gberkes gberkes commented Aug 7, 2024

what

Used the init-statement to declare "pos" inside the if statement.

why

C++17 introduced a construct to create and initialize a variable within the condition of if and switch statements, and C++20 added this construct to range-based for loops. Using this new feature simplifies common code patterns and helps in giving variables the right scope.

references

Sonarcloud: Use the init-statement to declare "pos" inside the if statement.

…ement.

C++17 introduced a construct to create and initialize a variable within the
condition of if and switch statements, and C++20 added this construct to
range-based for loops. Using this new feature simplifies common code patterns
and helps in giving variables the right scope.

Reference: https://sonarcloud.io/project/issues?open=AZDCieK2zGtqRpL2rnl-&id=owasp-modsecurity_ModSecurity
Copy link

sonarqubecloud bot commented Aug 7, 2024

@marcstern marcstern added the 3.x Related to ModSecurity version 3.x label Aug 7, 2024
Copy link
Member

@airween airween left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@airween airween merged commit e8db92e into owasp-modsecurity:v3/master Aug 7, 2024
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants