Ignore:
Timestamp:
Apr 28, 2018, 9:20:28 AM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, with_gc
Children:
6926a6d
Parents:
aa5fdac
Message:

shorten experimental code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/general/evaluation/cpp-vstack.cpp

    raa5fdac rac4dad2  
    55
    66void stack::clear() {
    7         for ( node * next = head; next; ) {
    8                 node * crnt = next;
    9                 next = crnt->next;
    10                 delete crnt;
     7        for ( node * nx = head; nx; ) {
     8                node * cr = nx;
     9                nx = cr->next;
     10                delete cr;
    1111        }
    1212        head = nullptr;
     
    1414
    1515void stack::copy( const stack & o ) {
    16         node ** crnt = &head;
    17         for ( node * next = o.head; next; next = next->next ) {
    18                 *crnt = new node{ *next->value }; /***/
    19                 crnt = &(*crnt)->next;
     16        node ** cr = &head;
     17        for ( node * nx = o.head; nx; nx = nx->next ) {
     18                *cr = new node{ *nx->value }; /***/
     19                cr = &(*cr)->next;
    2020        }
    21         *crnt = nullptr;
     21        *cr = nullptr;
    2222}
    2323
Note: See TracChangeset for help on using the changeset viewer.