MT#59962 ModSbc: use move instead of copy for mf

Instead of copying the FilterEntry mf, do the move.

Fixes defect:

329         vector<string> elems = explode(value, ",");
330         for (vector<string>::iterator it=elems.begin(); it != elems.end(); it++)
331         {
332           mf.filter_list.insert(*it);
333         }
334         mf.filter_type = Undefined;
>>>     CID 550235:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "mf" is copied and then passed-by-reference as parameter to STL insertion function
            "std::vector<FilterEntry, std::allocator<FilterEntry> >::push_back(
            std::vector<FilterEntry, std::allocator<FilterEntry> >::value_type const &)",
            when it could be moved instead.
335         profile->messagefilter.push_back(mf);
336         DBG("message_list set to '%s'\n", value.c_str());
337         EXEC_ACTION_STOP;
338       }
339
340       }

Change-Id: If6d04432f7004993fb1c70a0a026799805ed2a1a
mr13.4
Donat Zenichev 1 year ago
parent d29059b6f1
commit 357b2045d6

@ -332,7 +332,7 @@ EXEC_ACTION_START(MODSBCActionProfileSet) {
mf.filter_list.insert(*it);
}
mf.filter_type = Undefined;
profile->messagefilter.push_back(mf);
profile->messagefilter.push_back(std::move(mf));
DBG("message_list set to '%s'\n", value.c_str());
EXEC_ACTION_STOP;
}

Loading…
Cancel
Save