Fix Coverity "missing move operator" (copy to rvalue).

Also makes this bit of code more readable, but the overall handling of
Unicode characters in Actions and Transitions is messy, and may get
reworked later.
This commit is contained in:
John Hood
2016-11-20 00:43:47 -05:00
parent 24eb5a7544
commit 8fcfb3a587
+9 -8
View File
@@ -61,15 +61,16 @@ Transition State::anywhere_rule( wchar_t ch ) const
Transition State::input( wchar_t ch ) const
{
Transition ret = anywhere_rule( ch );
if ( !ret.next_state ) {
if ( ch >= 0xA0 ) {
ret = this->input_state_rule( 0x41 );
} else {
ret = this->input_state_rule( ch );
}
/* Check for immediate transitions. */
Transition anywhere = anywhere_rule( ch );
if ( anywhere.next_state ) {
anywhere.action->char_present = true;
anywhere.action->ch = ch;
return anywhere;
}
/* Normal X.364 state machine. */
/* Parse high Unicode codepoints like 'A'. */
Transition ret = this->input_state_rule( ch >= 0xA0 ? 0x41 : ch );
ret.action->char_present = true;
ret.action->ch = ch;
return ret;