Re: [PATCH 2/4] test-line-buffer: simplify command parsing

2017-09-21 Thread Junio C Hamano
Jeff King writes: > However, each case arm of the switch falls through to the > one below it. This is pointless (we know that a command > starting with 'b' does not need to check any of the commands > in the 'c' block), and it makes gcc's -Wimplicit-fallthrough > complain. Wow, this is an embara

[PATCH 2/4] test-line-buffer: simplify command parsing

2017-09-20 Thread Jeff King
The handle_command() function matches an incoming command string with a sequence of starts_with() checks. But it also surrounds these with a switch on the first character of the command, which lets us jump to the right block of starts_with() without going linearly through the list. However, each c