ModSecurity is an open source, cross platform web application firewall (WAF) engine for Apache, IIS and Nginx. It has a robust event-based programming language which provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis.
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).
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 thefind()
(doc).