From a9e00793fe9a843fecb8936ff27ad01f87226981 Mon Sep 17 00:00:00 2001 From: Sampo Savolainen Date: Mon, 11 Aug 2008 16:04:27 +0000 Subject: [PATCH] Make global static children variable an xml node object variable. git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3683 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/pbd/xml++.h | 1 + libs/pbd/xml++.cc | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h index bf26a6f685..f98f7854d1 100644 --- a/libs/pbd/pbd/xml++.h +++ b/libs/pbd/pbd/xml++.h @@ -73,6 +73,7 @@ private: XMLNodeList _children; XMLPropertyList _proplist; XMLPropertyMap _propmap; + mutable XMLNodeList _selected_children; public: XMLNode(const string &); diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 5507f658e9..942727a041 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -241,22 +241,21 @@ XMLNode::children(const string& n) const { /* returns all children matching name */ - static XMLNodeList retval; XMLNodeConstIterator cur; if (n.empty()) { return _children; } - - retval.erase(retval.begin(), retval.end()); + + _selected_children.clear(); for (cur = _children.begin(); cur != _children.end(); ++cur) { if ((*cur)->name() == n) { - retval.insert(retval.end(), *cur); + _selected_children.insert(_selected_children.end(), *cur); } } - return retval; + return _selected_children; } XMLNode * -- 2.30.2