Changeset 6b8643d


Ignore:
Timestamp:
May 30, 2018, 2:25:48 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
80a7d48
Parents:
1ed958c3
Message:

Remove clones from validateFunctionAlternative

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r1ed958c3 r6b8643d  
    924924
    925925        template<typename OutputIterator>
    926         void AlternativeFinder::Finder::validateFunctionAlternative( const Alternative &func, ArgPack& result,
    927                         const std::vector<ArgPack>& results, OutputIterator out ) {
    928                 ApplicationExpr *appExpr = new ApplicationExpr( func.expr->clone() );
     926        void AlternativeFinder::Finder::validateFunctionAlternative( const Alternative &func,
     927                        ArgPack& result, const std::vector<ArgPack>& results, OutputIterator out ) {
     928                ApplicationExpr *appExpr = new ApplicationExpr( func.expr );
    929929                // sum cost and accumulate actuals
    930930                std::list<Expression*>& args = appExpr->args;
     
    932932                const ArgPack* pack = &result;
    933933                while ( pack->expr ) {
    934                         args.push_front( pack->expr->clone() );
     934                        args.push_front( pack->expr );
    935935                        cost += pack->cost;
    936936                        pack = &results[pack->parent];
Note: See TracChangeset for help on using the changeset viewer.