Skip to content
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

fix: Changed 'equal_range()' + loop by 'find()' in resolveFirst() methods #3117

Open
wants to merge 2 commits into
base: v3/master
Choose a base branch
from

Conversation

airween
Copy link
Member

@airween airween commented Mar 29, 2024

This PR fixes SonarCloud issues in these files:

Summary: AnchoredSetVariable and InMemoryCollection types are derived from std::unordered_multimap.

Both type has a resolveFirst(key) method (AnchoredSetVariable, InMemoryCollection), which finds the first occurrence of key in the collection.

The current implemented version uses equal_range() (doc) to find the key in a loop, and breaks from that after first match. This C++ collection has another method to find it where we don't need any loop, that's the find() (doc).

@airween airween added the 3.x Related to ModSecurity version 3.x label Mar 29, 2024
@airween airween self-assigned this Mar 29, 2024
Copy link

sonarcloud bot commented Mar 31, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

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.

None yet

2 participants