Changeset 4e7cc5ce for src/ResolvExpr


Ignore:
Timestamp:
May 31, 2018, 3:46:59 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
5de1e2c
Parents:
cf5e5b1
Message:

Minor cleanup

Location:
src/ResolvExpr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Alternative.cc

    rcf5e5b1 r4e7cc5ce  
    2727
    2828namespace ResolvExpr {
    29         Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( 0 ) {}
     29        Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( nullptr ) {}
    3030
    3131        Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost )
     
    4848        }
    4949
    50         Alternative::Alternative( Alternative && other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), env( other.env ) {
     50        Alternative::Alternative( Alternative && other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), env( std::move( other.env ) ) {
    5151                other.expr = nullptr;
    5252        }
     
    5858                cvtCost = other.cvtCost;
    5959                expr = other.expr;
    60                 env = other.env;
     60                env = std::move( other.env );
    6161                other.expr = nullptr;
    6262                return *this;
  • src/ResolvExpr/TypeEnvironment.cc

    rcf5e5b1 r4e7cc5ce  
    5050        }
    5151
    52         EqvClass::EqvClass() : type( 0 ), allowWidening( true ) {
     52        EqvClass::EqvClass() : type( nullptr ), allowWidening( true ) {
    5353        }
    5454
     
    159159
    160160        void TypeEnvironment::print( std::ostream &os, Indenter indent ) const {
    161                 for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) {
    162                         i->print( os, indent );
     161                for ( const EqvClass & theClass : env ) {
     162                        theClass.print( os, indent );
    163163                } // for
    164164        }
Note: See TracChangeset for help on using the changeset viewer.