Ignore:
Timestamp:
Aug 31, 2021, 1:49:10 AM (3 years ago)
Author:
Jacob Prud'homme <jafprudhomme@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, pthread-emulation, qualifiedEnum
Children:
c166f4e
Parents:
1764a63
git-author:
Jacob Prud'homme <jafprudhomme@…> (08/13/21 17:10:06)
git-committer:
Jacob Prud'homme <jafprudhomme@…> (08/31/21 01:49:10)
Message:

Simplified validation logic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/parseconfig.cfa

    r1764a63 ra3f2a3e  
    119119                for ( j; num_entries ) {
    120120                  if ( strcmp( src_key, entries[j].key ) != 0 ) continue;
     121                        // Parse the data
    121122                        if ( !entries[j].parse( src_value, entries[j].variable ) ) {
    122123                                delete( kv_pairs );
     
    124125                        }
    125126
    126                         // Validate the parsed data, if necessary
    127                         if ( entries[j].validate != (bool (*)(void *))0p
    128                                         && !entries[j].validate( entries[j].variable ) ) {
     127                        // Validate the data
     128                        if ( !entries[j].validate( entries[j].variable ) ) {
    129129                                delete( kv_pairs );
    130130                                throw (Validation_Failure){};
Note: See TracChangeset for help on using the changeset viewer.