shared/format-table: use goto to make code flow clear
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 7 Apr 2021 15:01:50 +0000 (17:01 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 7 Apr 2021 15:05:35 +0000 (17:05 +0200)
commit46cbdcd9fe8e6f30f1e3ec3ce4d0360ac4f55243
treeb116d8363960213947d258240f881775c56187cd
parent4a3ad75efa4a4ac5ad1a65aec5d9cfb523ebffe6
shared/format-table: use goto to make code flow clear

gcc 9.3.0 "cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0" with --optimization=1 was
not able to figure out that all cases are covered because r is either set in
the switch or type < _TABLE_DATA_TYPE_MAX.

But for a human reader this might also not be obvious: the cases are not in
exactly the same order as enum definitions, and it's a long list. By using the
goto, there should be no doubt, and we avoid checking the condition a second
time.
src/shared/format-table.c