@@ -223,12 +223,9 @@ void RuleWithActions::executeActionsAfterFullMatch(Transaction *trans) const {
223
223
* FIXME: SecRuleUpdateActionBy should be runtime
224
224
*
225
225
*/
226
- for (auto &b :
227
- trans->m_rules ->m_exceptions .m_action_pos_update_target_by_id ) {
228
- if (m_ruleId != b.first ) {
229
- continue ;
230
- }
231
- ActionWithExecution *a = dynamic_cast <ActionWithExecution*>(b.second .get ());
226
+ auto range = trans->m_rules ->m_exceptions .m_action_pos_update_target_by_id .equal_range (m_ruleId);
227
+ for (auto it = range.first ; it != range.second ; ++it) {
228
+ ActionWithExecution *a = dynamic_cast <ActionWithExecution*>(it->second .get ());
232
229
if (dynamic_cast <ActionDisruptive *>(a)) {
233
230
trans->messageGetLast ()->setRule (this );
234
231
}
@@ -328,23 +325,16 @@ void RuleWithActions::executeTransformations(
328
325
329
326
// FIXME: It can't be something different from transformation. Sort this
330
327
// on rules compile time.
331
- for (auto &b :
332
- trans->m_rules ->m_exceptions .m_action_transformation_update_target_by_id ) {
333
- if (m_ruleId != b.first ) {
334
- continue ;
335
- }
336
- Transformation *t = b.second .get ();
328
+ auto range = trans->m_rules ->m_exceptions .m_action_transformation_update_target_by_id .equal_range (m_ruleId);
329
+ for (auto it = range.first ; it != range.second ; ++it) {
330
+ Transformation *t = it->second .get ();
337
331
if (dynamic_cast <actions::transformations::None *>(t)) {
338
332
none++;
339
333
}
340
334
}
341
335
342
- for (auto &b :
343
- trans->m_rules ->m_exceptions .m_action_transformation_update_target_by_id ) {
344
- if (m_ruleId != b.first ) {
345
- continue ;
346
- }
347
- Transformation *t = b.second .get ();
336
+ for (auto it = range.first ; it != range.second ; ++it) {
337
+ Transformation *t = it->second .get ();
348
338
if (none == 0 ) {
349
339
executeTransformation (trans, &results, t);
350
340
}
0 commit comments