From 445bfd2f28ae9f118676afc00f23fc7c3a3645f0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Dec 2009 16:54:39 +0200 Subject: Optimize ID registration Now we maintain the the ID-to-container map in the root of the tree. --- libxsd/xsd/cxx/tree/types.txx | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'libxsd/xsd/cxx/tree/types.txx') 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:: 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 void id:: 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_); } -- cgit v1.1