diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-12-28 16:54:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-12-28 16:54:39 +0200 |
commit | 445bfd2f28ae9f118676afc00f23fc7c3a3645f0 (patch) | |
tree | bef7e669dc671b97070ba08a35505d497625b810 /libxsd/xsd/cxx/tree/types.txx | |
parent | f3d25e138d506d57b16bd50023e762459983ff95 (diff) |
Optimize ID registration
Now we maintain the the ID-to-container map in the root of the tree.
Diffstat (limited to 'libxsd/xsd/cxx/tree/types.txx')
-rw-r--r-- | libxsd/xsd/cxx/tree/types.txx | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/libxsd/xsd/cxx/tree/types.txx b/libxsd/xsd/cxx/tree/types.txx index 799c5fa..7c9d696 100644 --- a/libxsd/xsd/cxx/tree/types.txx +++ b/libxsd/xsd/cxx/tree/types.txx @@ -185,32 +185,20 @@ namespace xsd void id<C, B>:: register_id () { - container* c (this->_container ()); + container* r (this->_root ()); - if (c != 0 && !this->empty ()) - { - //std::cerr << "registering " << c - // << " as '" << *this - // << "' on " << c << std::endl; - - c->_register_id (identity_, c); - } + if (r != 0 && !this->empty ()) + r->_register_id (identity_, this->_container ()); } template <typename C, typename B> void id<C, B>:: unregister_id () { - container* c (this->_container ()); + container* r (this->_root ()); - if (c != 0 && !this->empty ()) - { - //std::cerr << "un-registering " << c - // << " as '" << *this - // << "' on " << c << std::endl; - - c->_unregister_id (identity_); - } + if (r != 0 && !this->empty ()) + r->_unregister_id (identity_); } |