Changeset 16ba4897 for src/Validate


Ignore:
Timestamp:
Oct 9, 2024, 5:07:59 PM (2 weeks ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
0766399
Parents:
1b770e40
Message:

Replaced SemanticErrorException::isEmpty with ...::throwIfNonEmpty. This is how it was used in every context and it saves a bit of text (if not two lines) at every use. I considered putting this function in the header for better inlining, but this should have at least the same preformance as the last version.

Location:
src/Validate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/CheckAssertions.cpp

    r1b770e40 r16ba4897  
    6060                makeTypeVarMap( decl, typeVars );
    6161                checkList( typeVars, errors, decl->assertions );
    62                 if ( !errors.isEmpty() ) { throw errors; }
     62                errors.throwIfNonEmpty();
    6363        }
    6464
     
    7272                }
    7373                if ( checkMembers ) checkList( typeVars, errors, decl->members );
    74                 if ( !errors.isEmpty() ) { throw errors; }
     74                errors.throwIfNonEmpty();
    7575        }
    7676
  • src/Validate/ReplaceTypedef.cpp

    r1b770e40 r16ba4897  
    327327        assert( declsToAddBefore.empty() );
    328328        assert( declsToAddAfter.empty() );
    329         if ( !errors.isEmpty() ) { throw errors; }
     329        errors.throwIfNonEmpty();
    330330
    331331        mut->members.clear();
Note: See TracChangeset for help on using the changeset viewer.