Ignore:
Timestamp:
Mar 19, 2012, 1:59:48 AM (12 years ago)
Author:
イグトランス (egtra)
Message:

egtraブランチの内容をマージ。

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ab5.0/abdev

    • Property svn:ignore set to
      *.opensdf
      *.sdf
      *.suo
      *.user
      int
      ipch
      out
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp

    r700 r828  
    2929CConst *Consts::GetObjectPtr( const Symbol &symbol )
    3030{
    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;
    4237}
    4338
     
    131126ConstMacro *ConstMacros::Find( const Symbol &symbol )
    132127{
    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;
    144134}
Note: See TracChangeset for help on using the changeset viewer.