File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,11 +163,11 @@ void ParseEncodedItem(EncodedItem item)
163163 switch ( item . TagForGlobal )
164164 {
165165 case GlobalItemTag . Push :
166- State . GlobalItemStateStack . Add ( new Dictionary < GlobalItemTag , EncodedItem > ( State . GlobalItemState ) ) ;
166+ State . GlobalItemStateStack . Push ( new Dictionary < GlobalItemTag , EncodedItem > ( State . GlobalItemState ) ) ;
167167 break ;
168168
169169 case GlobalItemTag . Pop :
170- State . GlobalItemStateStack . RemoveAt ( State . GlobalItemState . Count - 1 ) ;
170+ State . GlobalItemStateStack . Pop ( ) ;
171171 break ;
172172
173173 case GlobalItemTag . ReportID :
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ sealed class ReportDescriptorParseState
2727 public ReportDescriptorParseState ( )
2828 {
2929 RootItem = new DescriptorCollectionItem ( ) ;
30- GlobalItemStateStack = new List < IDictionary < GlobalItemTag , EncodedItem > > ( ) ;
30+ GlobalItemStateStack = new Stack < IDictionary < GlobalItemTag , EncodedItem > > ( ) ;
3131 LocalItemState = new List < KeyValuePair < LocalItemTag , uint > > ( ) ;
3232 Reset ( ) ;
3333 }
@@ -39,7 +39,7 @@ public void Reset()
3939 RootItem . CollectionType = 0 ;
4040
4141 GlobalItemStateStack . Clear ( ) ;
42- GlobalItemStateStack . Add ( new Dictionary < GlobalItemTag , EncodedItem > ( ) ) ;
42+ GlobalItemStateStack . Push ( new Dictionary < GlobalItemTag , EncodedItem > ( ) ) ;
4343 LocalItemState . Clear ( ) ;
4444 }
4545
@@ -75,10 +75,10 @@ public DescriptorCollectionItem RootItem
7575
7676 public IDictionary < GlobalItemTag , EncodedItem > GlobalItemState
7777 {
78- get { return GlobalItemStateStack [ GlobalItemStateStack . Count - 1 ] ; }
78+ get { return GlobalItemStateStack . Peek ( ) ; }
7979 }
8080
81- public IList < IDictionary < GlobalItemTag , EncodedItem > > GlobalItemStateStack
81+ public Stack < IDictionary < GlobalItemTag , EncodedItem > > GlobalItemStateStack
8282 {
8383 get ;
8484 private set ;
You can’t perform that action at this time.
0 commit comments