Move { and [ to the start of the switch

This commit is contained in:
John Keiser 2020-07-27 16:56:42 -07:00
parent bc8a6dd2e3
commit c46ea0390c
1 changed files with 6 additions and 6 deletions

View File

@ -200,6 +200,12 @@ struct structural_parser : structural_iterator {
}
WARN_UNUSED really_inline ret_address_t parse_value(const unified_machine_addresses &addresses, ret_address_t continue_state) {
switch (advance_char()) {
case '{':
FAIL_IF( start_object(continue_state) );
return addresses.object_begin;
case '[':
FAIL_IF( start_array(continue_state) );
return addresses.array_begin;
case '"':
FAIL_IF( parse_string() );
return continue_state;
@ -223,12 +229,6 @@ struct structural_parser : structural_iterator {
case '5': case '6': case '7': case '8': case '9':
FAIL_IF( parse_number() );
return continue_state;
case '{':
FAIL_IF( start_object(continue_state) );
return addresses.object_begin;
case '[':
FAIL_IF( start_array(continue_state) );
return addresses.array_begin;
default:
log_error("Non-value found when value was expected!");
return addresses.error;