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