From 62cadf03af778b508bd684be19c6e6958b2fe52f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Jul 2011 12:00:39 +0200 Subject: Make sure we don't process sourced schemas more than once --- xsde/processing/inheritance/processor.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'xsde/processing') diff --git a/xsde/processing/inheritance/processor.cxx b/xsde/processing/inheritance/processor.cxx index 5900239..79615c3 100644 --- a/xsde/processing/inheritance/processor.cxx +++ b/xsde/processing/inheritance/processor.cxx @@ -422,6 +422,21 @@ namespace Processing }; + // Sources traverser that goes into each schema only once. + // + struct Sources: Traversal::Sources + { + virtual void + traverse (SemanticGraph::Sources& s) + { + if (schemas_.insert (&s.schema ()).second) + Traversal::Sources::traverse (s); + } + + private: + Cult::Containers::Set schemas_; + }; + // Go into included/imported schemas while making sure we don't // process the same stuff more than once. // @@ -453,7 +468,7 @@ namespace Processing if (!s.context ().count ("processing-inheritance-seen")) { Traversal::Schema schema; - Traversal::Sources sources; + Sources sources; schema >> sources >> schema; schema >> *this; @@ -492,7 +507,7 @@ namespace Processing // rely on the order of types in the schema. // Traversal::Schema schema; - Traversal::Sources sources; + Sources sources; Uses uses (tu, by_value_key, failed); schema >> sources >> schema; -- cgit v1.1