sorting nodes -> don't use shared pointer
This commit is contained in:
parent
0ddb883451
commit
d79ae7a819
1 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ bool FGHttpd::close() {
|
||||||
|
|
||||||
class CompareNodes {
|
class CompareNodes {
|
||||||
public:
|
public:
|
||||||
bool operator() (const SGPropertyNode_ptr a, const SGPropertyNode_ptr b) const {
|
bool operator() (const SGPropertyNode *a, const SGPropertyNode *b) const {
|
||||||
int r = strcmp(a->getName(), b->getName());
|
int r = strcmp(a->getName(), b->getName());
|
||||||
return r ? r < 0 : a->getIndex() < b->getIndex();
|
return r ? r < 0 : a->getIndex() < b->getIndex();
|
||||||
}
|
}
|
||||||
|
@ -204,12 +204,12 @@ void HttpdChannel::foundTerminator (void) {
|
||||||
response += getTerminator();
|
response += getTerminator();
|
||||||
|
|
||||||
|
|
||||||
vector<SGPropertyNode_ptr> children;
|
vector<SGPropertyNode *> children;
|
||||||
for (int i = 0; i < node->nChildren(); i++)
|
for (int i = 0; i < node->nChildren(); i++)
|
||||||
children.push_back(node->getChild(i));
|
children.push_back(node->getChild(i));
|
||||||
std::sort(children.begin(), children.end(), CompareNodes());
|
std::sort(children.begin(), children.end(), CompareNodes());
|
||||||
|
|
||||||
vector<SGPropertyNode_ptr>::iterator it, end = children.end();
|
vector<SGPropertyNode *>::iterator it, end = children.end();
|
||||||
for (it = children.begin(); it != end; ++it) {
|
for (it = children.begin(); it != end; ++it) {
|
||||||
SGPropertyNode *child = *it;
|
SGPropertyNode *child = *it;
|
||||||
string name = child->getDisplayName(true);
|
string name = child->getDisplayName(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue