Changeset 17f22e78
- Timestamp:
- Jul 21, 2017, 9:47:10 AM (7 years ago)
- 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:
- cb43451
- Parents:
- 9a34b5a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Cost.h
r9a34b5a r17f22e78 57 57 58 58 inline Cost & Cost::incUnsafe( int inc ) { 59 if ( *this == infinity ) return *this; 59 60 unsafeCost += inc; 60 61 return *this; … … 62 63 63 64 inline Cost & Cost::incPoly( int inc ) { 65 if ( *this == infinity ) return *this; 64 66 polyCost += inc; 65 67 return *this; … … 67 69 68 70 inline Cost & Cost::incSafe( int inc ) { 71 if ( *this == infinity ) return *this; 69 72 safeCost += inc; 70 73 return *this; … … 72 75 73 76 inline Cost & Cost::incReference( int inc ) { 77 if ( *this == infinity ) return *this; 74 78 referenceCost += inc; 75 79 return *this; … … 77 81 78 82 inline Cost Cost::operator+( const Cost &other ) const { 83 if ( *this == infinity || other == infinity ) return infinity; 79 84 return Cost( unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, referenceCost + other.referenceCost ); 80 85 } 81 86 82 87 inline Cost Cost::operator-( const Cost &other ) const { 88 if ( *this == infinity || other == infinity ) return infinity; 83 89 return Cost( unsafeCost - other.unsafeCost, polyCost - other.polyCost, safeCost - other.safeCost, referenceCost - other.referenceCost ); 84 90 } 85 91 86 92 inline Cost &Cost::operator+=( const Cost &other ) { 93 if ( *this == infinity ) return *this; 94 if ( other == infinity ) { 95 *this = infinity; 96 return *this; 97 } 87 98 unsafeCost += other.unsafeCost; 88 99 polyCost += other.polyCost;
Note: See TracChangeset
for help on using the changeset viewer.