]> git.mxchange.org Git - simgear.git/commit
Made SGPropertyNode::getPath extremely efficient: it now caches its
authordavid <david>
Sat, 6 Jul 2002 13:19:02 +0000 (13:19 +0000)
committerdavid <david>
Sat, 6 Jul 2002 13:19:02 +0000 (13:19 +0000)
commit90e8287f43cf0f5e0da8e2404912df70a58e4e96
treed0ced9fbad9dee65181fd516aa0de93bb1267c2b
parentd8b7e5b8fd4dde284d3552d8484cdef8fb867d97
Made SGPropertyNode::getPath extremely efficient: it now caches its
result, so after the first call for any node, it simply tests and
returns a pointer.  This also fixes the problem of buffer conflicts
with make_string.

Added SGPropertyNode::hasChild(const char * name, int index = 0) to
provide a syntactically-cleaner way to test for the existence of a
child node, i.e.

  for (int i = 0; i < 9; i++) {
    if (node->hasChild("foo", i))
      foo[i] = node->getChild("foo", i)->getDoubleValue();
  }
simgear/misc/props.cxx
simgear/misc/props.hxx