Changeset 75308bcc for src


Ignore:
Timestamp:
May 30, 2018, 3:57:01 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
8e18b8e
Parents:
8a1289f
Message:

Remove clones from Tuples::Explode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/Explode.h

    r8a1289f r75308bcc  
    8484                                // tuple type, but not tuple expr - recursively index into its components.
    8585                                // if expr type is reference, convert to value type
    86                                 Expression * arg = expr->clone();
     86                                Expression * arg = expr;
    8787                                if ( Tuples::maybeImpureIgnoreUnique( arg ) ) {
    8888                                        // expressions which may contain side effects require a single unique instance of the expression.
     
    9494                                }
    9595                                for ( unsigned int i = 0; i < tupleType->size(); i++ ) {
    96                                         TupleIndexExpr * idx = new TupleIndexExpr( arg->clone(), i );
     96                                        TupleIndexExpr * idx = new TupleIndexExpr( arg, i );
    9797                                        explodeUnique( idx, alt, indexer, std::forward<Output>(out), isTupleAssign );
    9898                                }
    9999                        }
    100100                } else {
    101                         // atomic (non-tuple) type - output a clone of the expression in a new alternative
    102                         append( std::forward<Output>(out), expr->clone(), alt.env, alt.cost, alt.cvtCost );
     101                        // atomic (non-tuple) type - output the expression in a new alternative
     102                        append( std::forward<Output>(out), expr, alt.env, alt.cost, alt.cvtCost );
    103103                }
    104104        }
Note: See TracChangeset for help on using the changeset viewer.