@@ -431,16 +431,16 @@ std::list<std::pair<std::shared_ptr<std::string>,
431431
432432std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars (
433433 Transaction *trans) {
434- std::list<const std::string* > exclusions;
435- std::list<const std::string* > exclusions_update_by_tag_remove;
436- std::list<const std::string* > exclusions_update_by_id_remove;
434+ std::list<std::shared_ptr<std:: string> > exclusions;
435+ std::list<std::shared_ptr<std:: string> > exclusions_update_by_tag_remove;
436+ std::list<std::shared_ptr<std:: string> > exclusions_update_by_id_remove;
437437 std::vector<Variables::Variable *> variables;
438438 std::vector<std::unique_ptr<collection::Variable>> finalVars;
439439
440440 std::copy (m_variables->begin (), m_variables->end (), std::back_inserter (variables));
441441
442442 for (auto &a : trans->m_rules ->m_exceptions .m_variable_update_target_by_tag ) {
443- if (containsTag (a.first , trans) == false ) {
443+ if (containsTag (* a.first . get () , trans) == false ) {
444444 continue ;
445445 }
446446 if (a.second ->m_isExclusion ) {
@@ -449,7 +449,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
449449 for (auto &y : z) {
450450 exclusions_update_by_tag_remove.push_back (y->m_key );
451451 }
452- exclusions_update_by_tag_remove.push_back (& a.second ->m_name );
452+ exclusions_update_by_tag_remove.push_back (std::make_shared<std::string>( a.second ->m_name ) );
453453
454454 } else {
455455 Variable *b = a.second .get ();
@@ -467,7 +467,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
467467 for (auto &y : z) {
468468 exclusions_update_by_id_remove.push_back (y->m_key );
469469 }
470- exclusions_update_by_id_remove.push_back (& a.second ->m_name );
470+ exclusions_update_by_id_remove.push_back (std::make_shared<std::string>( a.second ->m_name ) );
471471 } else {
472472 Variable *b = a.second .get ();
473473 variables.push_back (b);
@@ -482,7 +482,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
482482 for (auto &y : z) {
483483 exclusions.push_back (y->m_key );
484484 }
485- exclusions.push_back (&variable->m_name );
485+ // exclusions.push_back(std::make_shared<std::string>( &variable->m_name) );
486486 }
487487 }
488488
@@ -497,9 +497,9 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
497497
498498 variable->evaluateInternal (trans, this , &e);
499499 for (const collection::Variable *v : e) {
500- const std::string * key = v->m_key ;
500+ const std::shared_ptr<std:: string> key = v->m_key ;
501501 if (std::find_if (exclusions.begin (), exclusions.end (),
502- [key](const std::string * m) -> bool { return *key == *m; })
502+ [key](std::shared_ptr<std:: string> m) -> bool { return *key == *m. get () ; })
503503 != exclusions.end ()) {
504504#ifndef NO_LOGS
505505 trans->debug (9 , " Variable: " + *key +
@@ -513,7 +513,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
513513 }
514514 if (std::find_if (exclusions_update_by_tag_remove.begin (),
515515 exclusions_update_by_tag_remove.end (),
516- [key](const std::string * m) -> bool { return *key == *m; })
516+ [key](std::shared_ptr<std:: string> m) -> bool { return *key == *m. get () ; })
517517 != exclusions_update_by_tag_remove.end ()) {
518518#ifndef NO_LOGS
519519 trans->debug (9 , " Variable: " + *key +
@@ -529,7 +529,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
529529
530530 if (std::find_if (exclusions_update_by_id_remove.begin (),
531531 exclusions_update_by_id_remove.end (),
532- [key](const std::string * m) -> bool { return *key == *m; })
532+ [key](std::shared_ptr<std:: string> m) -> bool { return *key == *m. get () ; })
533533 != exclusions_update_by_id_remove.end ()) {
534534#ifndef NO_LOGS
535535 trans->debug (9 , " Variable: " + *key +
@@ -621,8 +621,6 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
621621 std::unique_ptr<collection::Variable> var (new collection::Variable (
622622 new std::string (*v->m_key ),
623623 new std::string (*v->m_value )));
624- var->m_dynamic_value = true ;
625- var->m_dynamic_key = true ;
626624 for (auto &i : v->m_orign ) {
627625 std::unique_ptr<VariableOrigin> origin (new VariableOrigin ());
628626 origin->m_offset = i->m_offset ;
0 commit comments