Changeset 933667d
- Timestamp:
- Jan 13, 2016, 5:00:46 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 1194734
- Parents:
- 52bbd67
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/ScopedMap.h
r52bbd67 r933667d 176 176 const_iterator cend() const { return const_iterator(scopes, scopes[0].end(), 0); } 177 177 178 /// Gets the index of the current scope (counted from 1) 179 size_type currentScope() const { return scopes.size(); } 180 178 181 /// Finds the given key in the outermost scope it occurs; returns end() for none such 179 182 iterator find( const Key &key ) { 180 for ( size_type i = scopes.size() - 1; i > 0; --i ) {183 for ( size_type i = scopes.size() - 1; ; --i ) { 181 184 typename Scope::iterator val = scopes[i].find( key ); 182 185 if ( val != scopes[i].end() ) return iterator( scopes, val, i ); 186 if ( i == 0 ) break; 183 187 } 184 188 return end(); … … 189 193 iterator findNext( const_iterator &it, const Key &key ) { 190 194 if ( it.i == 0 ) return end(); 191 for ( size_type i = it.i - 1; i > 0; --i ) {195 for ( size_type i = it.i - 1; ; --i ) { 192 196 typename Scope::iterator val = scopes[i].find( key ); 193 197 if ( val != scopes[i].end() ) return iterator( scopes, val, i ); 198 if ( i == 0 ) break; 194 199 } 195 200 return end();
Note: See TracChangeset
for help on using the changeset viewer.