osaf/services/saf/amf/amfd/sgproc.cc | 25 +++++++++----------------
1 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/osaf/services/saf/amf/amfd/sgproc.cc
b/osaf/services/saf/amf/amfd/sgproc.cc
--- a/osaf/services/saf/amf/amfd/sgproc.cc
+++ b/osaf/services/saf/amf/amfd/sgproc.cc
@@ -902,7 +902,7 @@
{
AVD_DND_MSG *n2d_msg = evt->info.avnd_msg;
AVD_AVND *node;
- AVD_SU *su, *temp_su;
+ AVD_SU *su;
AVD_SU_SI_REL *susi;
bool q_flag = false, qsc_flag = false, all_su_unassigned = true,
all_csi_rem = true;
@@ -1371,8 +1371,7 @@
if (n2d_msg->msg_info.n2d_su_si_assign.error ==
NCSCC_RC_SUCCESS) {
if ((su->sg_of_su->sg_redundancy_model ==
SA_AMF_N_WAY_REDUNDANCY_MODEL) &&
(su->sg_of_su->sg_fsm_state ==
AVD_SG_FSM_STABLE)) {
- for (temp_su =
su->sg_of_su->list_of_su; temp_su != NULL;
- temp_su =
temp_su->sg_list_su_next) {
+ for (const auto& temp_su :
su->sg_of_su->list_of_su) {
temp_su->complete_admin_op(SA_AIS_OK);
}
} else
@@ -1512,7 +1511,7 @@
*/
AVD_SU* su_to_instantiate(AVD_SG *sg)
{
- for (AVD_SU* i_su = sg->list_of_su; i_su != NULL; i_su =
i_su->sg_list_su_next) {
+ for (const auto& i_su : sg->list_of_su) {
TRACE("%s", i_su->name.value);
if (i_su->is_instantiable())
return i_su;
@@ -1530,7 +1529,7 @@
{
AmfDb<std::string, AVD_SU> *su_rank = NULL;
su_rank = new AmfDb<std::string, AVD_SU>;
- for (AVD_SU* i_su = sg->list_of_su; i_su != NULL; i_su =
i_su->sg_list_su_next) {
+ for (const auto& i_su : sg->list_of_su) {
TRACE("In Seq %s, %u", i_su->name.value, i_su->saAmfSURank);
su_rank->insert(Amf::to_string(&i_su->name), i_su);
}
@@ -1566,7 +1565,7 @@
{
TRACE_ENTER();
uint32_t in_serv = 0;
- for (AVD_SU* i_su = sg->list_of_su; i_su != NULL; i_su =
i_su->sg_list_su_next) {
+ for (const auto& i_su : sg->list_of_su) {
TRACE_ENTER2("%s", i_su->name.value);
if (i_su->is_in_service()) {
TRACE_ENTER2(" in_serv_su %s", i_su->name.value);
@@ -1606,13 +1605,11 @@
uint32_t num_asgd_su = 0;
uint32_t num_su = 0;
uint32_t num_try_insvc_su = 0;
- AVD_SU *i_su;
AVD_AVND *su_node_ptr = NULL;
TRACE_ENTER2("'%s'", sg->name.value);
- i_su = sg->list_of_su;
- while (i_su != NULL) {
+ for (const auto& i_su : sg->list_of_su) {
su_node_ptr = i_su->get_node_ptr();
num_su++;
/* Check if the SU is inservice */
@@ -1689,9 +1686,6 @@
} else
TRACE("nop for %s", i_su->name.value);
}
- /* else if (i_su->num_of_comp == i_su->curr_num_comp) */
- i_su = i_su->sg_list_su_next;
-
} /* while (i_su != AVD_SU_NULL) */
/* The entire SG has been scanned for reinstatiations and terminations.
@@ -1729,7 +1723,6 @@
uint32_t avd_sg_app_sg_admin_func(AVD_CL_CB *cb, AVD_SG *sg)
{
uint32_t rc = NCSCC_RC_FAILURE;
- AVD_SU *i_su;
TRACE_ENTER2("'%s'", sg->name.value);
@@ -1749,7 +1742,7 @@
* only when AvD is in AVD_APP_STATE. call the SG FSM with the
new readiness
* state.
*/
- for (i_su = sg->list_of_su; i_su != NULL; i_su =
i_su->sg_list_su_next) {
+ for (auto const& i_su : sg->list_of_su) {
if (i_su->is_in_service() == true) {
i_su->set_readiness_state(SA_AMF_READINESS_IN_SERVICE);
}
@@ -1758,7 +1751,7 @@
if (sg->realign(cb, sg) == NCSCC_RC_FAILURE) {
/* set all the SUs to OOS return failure */
- for (i_su = sg->list_of_su; i_su != NULL; i_su =
i_su->sg_list_su_next) {
+ for (auto const& i_su : sg->list_of_su) {
i_su->set_readiness_state(SA_AMF_READINESS_OUT_OF_SERVICE);
}
@@ -1776,7 +1769,7 @@
goto done;
}
- for (i_su = sg->list_of_su; i_su != NULL; i_su =
i_su->sg_list_su_next) {
+ for (auto const& i_su : sg->list_of_su) {
i_su->set_readiness_state(SA_AMF_READINESS_OUT_OF_SERVICE);
}
break;
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel