get rid of piForeach
apply some code analyzer recommendations ICU flag now check if libicu exists prepare for more accurate growth of containers (limited PoT, then constantly increase size)
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
PIStringList PICollection::groups() {
|
||||
PIStringList sl;
|
||||
PIVector<PICollection::Group> & cg(_groups());
|
||||
piForeachC(Group & g, cg)
|
||||
for (const auto & g: cg)
|
||||
sl << g.name;
|
||||
return sl;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ PIStringList PICollection::groups() {
|
||||
|
||||
PIVector<const PIObject *> PICollection::groupElements(const PIString & group) {
|
||||
PIVector<PICollection::Group> & cg(_groups());
|
||||
piForeachC(Group & g, cg)
|
||||
for (const auto & g: cg)
|
||||
if (g.name == group) return g.elements;
|
||||
return PIVector<const PIObject *>();
|
||||
}
|
||||
@@ -58,7 +58,7 @@ bool PICollection::addToGroup(const PIString & group, const PIObject * element)
|
||||
// piCout << "add to" << group << element;
|
||||
PIString n = PIStringAscii(element->className());
|
||||
PIVector<PICollection::Group> & cg(_groups());
|
||||
piForeach(Group & g, cg)
|
||||
for (auto & g: cg)
|
||||
if (g.name == group) {
|
||||
for (int i = 0; i < g.elements.size_s(); ++i)
|
||||
if (PIString(g.elements[i]->className()) == n) return false;
|
||||
|
||||
Reference in New Issue
Block a user