Ignore:
Timestamp:
Apr 12, 2017, 3:57:49 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
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, resolv-new, with_gc
Children:
e869e434
Parents:
eaa5043
Message:

Fix performance bug in C++ virtual benchmark

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/cpp-vbench.cpp

    reaa5043 rb14dd03  
    4242        )
    4343
    44         pair max2 = { std::make_unique<boolean>(false), std::make_unique<character>('\0') };
     44        auto max2 = std::make_unique<pair>( std::make_unique<boolean>(false),
     45                std::make_unique<character>('\0') );
    4546        REPEAT_TIMED( "pop_bool_char",
    46                 max2 = std::max( max2, t2.pop()->as<pair>() );
     47                std::unique_ptr<object> x = t2.pop();
     48                if ( x->as<pair>() > *max2 ) { max2.reset( static_cast<pair*>(x.release()) ); }
    4749        )
    4850}
Note: See TracChangeset for help on using the changeset viewer.