diff options
Diffstat (limited to 'TAO/TAO_IDL/ast/ast_union_branch.cpp')
-rw-r--r-- | TAO/TAO_IDL/ast/ast_union_branch.cpp | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/TAO/TAO_IDL/ast/ast_union_branch.cpp b/TAO/TAO_IDL/ast/ast_union_branch.cpp index d8dbfa29552..b2518e3cb61 100644 --- a/TAO/TAO_IDL/ast/ast_union_branch.cpp +++ b/TAO/TAO_IDL/ast/ast_union_branch.cpp @@ -82,15 +82,15 @@ ACE_RCSID(ast, ast_union_branch, "$Id$") * Constructor(s) and destructor */ AST_UnionBranch::AST_UnionBranch() - : pd_ll (NULL) + : pd_label(NULL) { } -AST_UnionBranch::AST_UnionBranch (UTL_LabelList *ll, AST_Type *ft, +AST_UnionBranch::AST_UnionBranch(AST_UnionLabel *fl, AST_Type *ft, UTL_ScopedName *n, UTL_StrList *p) : AST_Field(AST_Decl::NT_union_branch, ft, n, p), AST_Decl(AST_Decl::NT_union_branch, n, p), - pd_ll (ll) + pd_label(fl) { } @@ -112,14 +112,9 @@ AST_UnionBranch::AST_UnionBranch (UTL_LabelList *ll, AST_Type *ft, void AST_UnionBranch::dump(ostream &o) { - for (unsigned long i = 0; - i < this->label_list_length (); ++i) - { - o << "case "; - AST_UnionLabel *ul = this->label (i); - ul->dump(o); - o << ": \n"; - } + o << "case "; + pd_label->dump(o); + o << ": "; AST_Field::dump(o); } @@ -128,29 +123,9 @@ AST_UnionBranch::dump(ostream &o) */ AST_UnionLabel * -AST_UnionBranch::label (unsigned long index) +AST_UnionBranch::label() { - unsigned long i = 0; - UTL_LabellistActiveIterator iter (this->pd_ll); - - for (; !iter.is_done (); iter.next ()) - { - if (i == index) - { - return iter.item (); - } - ++i; - } - return 0; -} - -unsigned long -AST_UnionBranch::label_list_length (void) -{ - if (this->pd_ll) - return this->pd_ll->length (); - else - return 0; + return pd_label; } // Narrowing |