Changeset 828 in dev for trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp
- Timestamp:
- Mar 19, 2012, 1:59:48 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/egtra merged eligible
-
Property svn:mergeinfo
set to
-
trunk/ab5.0/abdev
-
Property svn:ignore
set to
*.opensdf
*.sdf
*.suo
*.user
int
ipch
out
-
Property svn:ignore
set to
-
trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp
r700 r828 29 29 CConst *Consts::GetObjectPtr( const Symbol &symbol ) 30 30 { 31 CConst *pConst = GetHashArrayElement( symbol.GetName().c_str() ); 32 while( pConst ) 33 { 34 if( pConst->IsEqualSymbol( symbol ) ) 35 { 36 break; 37 } 38 pConst = pConst->GetChainNext(); 39 } 40 41 return pConst; 31 auto c = GetHashArrayElement(symbol.GetName()); 32 auto it = std::find_if(c.begin(), c.end(), 33 [&](CConst* t) {return t->IsEqualSymbol(symbol);}); 34 return it != c.end() 35 ? *it 36 : nullptr; 42 37 } 43 38 … … 131 126 ConstMacro *ConstMacros::Find( const Symbol &symbol ) 132 127 { 133 ConstMacro *pConstMacro = GetHashArrayElement( symbol.GetName().c_str() ); 134 while( pConstMacro ) 135 { 136 if( pConstMacro->IsEqualSymbol( symbol ) ) 137 { 138 break; 139 } 140 pConstMacro = pConstMacro->GetChainNext(); 141 } 142 143 return pConstMacro; 128 auto c = GetHashArrayElement(symbol.GetName()); 129 auto it = std::find_if(c.begin(), c.end(), 130 [&](ConstMacro* t) {return t->IsEqualSymbol(symbol);}); 131 return it != c.end() 132 ? *it 133 : nullptr; 144 134 }
Note:
See TracChangeset
for help on using the changeset viewer.