Changeset 1b772749 for src/Common


Ignore:
Timestamp:
Sep 16, 2016, 10:48:28 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
2298f728
Parents:
ba7aa2d
Message:

more refactoring of parser code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    rba7aa2d r1b772749  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun  8 17:33:59 2016
    13 // Update Count     : 22
     12// Last Modified On : Fri Sep 16 19:13:21 2016
     13// Update Count     : 26
    1414//
    1515
     
    2525#include <sstream>
    2626#include <string>
     27#include <cassert>
    2728
    2829template< typename T >
     
    104105
    105106static inline std::string assign_strptr( const std::string *str ) {
    106         if ( str == 0 ) {
    107                 return "";
    108         } else {
    109                 std::string tmp;
    110                 tmp = *str;
    111                 delete str;
    112                 return tmp;
    113         } // if
     107        std::string tmp( *str );
     108        delete str;
     109        return tmp;
    114110}
    115111
Note: See TracChangeset for help on using the changeset viewer.