From: Mike D. Lowis Date: Sat, 10 Mar 2012 20:54:36 +0000 (-0500) Subject: Optimized tree modifications in scheme printerw X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=6e470a750f6477930f55beb4f520b5f0d79c021f;p=archive%2Fdlang.git Optimized tree modifications in scheme printerw --- diff --git a/source/visitors/scheme/scheme.cpp b/source/visitors/scheme/scheme.cpp index 7a41368..1d69f8f 100644 --- a/source/visitors/scheme/scheme.cpp +++ b/source/visitors/scheme/scheme.cpp @@ -101,10 +101,7 @@ void Scheme::beforeChildren(AST* cur, int depth) { if (cur->type() == MEMB) { - AST* temp = cur->children()->back(); - cur->children()->pop_back(); - cur->children()->push_back( new AST(STRING, temp->text()) ); - delete temp; + cur->children()->back()->type(STRING); } if( isDatatype( cur->type() ) )