]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vsprintf: avoid nested switch statement on same variable
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 16 Dec 2024 18:26:53 +0000 (10:26 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 Dec 2024 19:18:35 +0000 (11:18 -0800)
commit03d23941bf03eecd8560e40238decb1515f264f6
tree26e48a1f52486591de892e773089d4dc234e7928
parentbe503db4d0f217bb1bb4b3e3639402d386378d1b
vsprintf: avoid nested switch statement on same variable

Now that we have simplified the number format types, the top-level
switch table can easily just handle all the remaining cases, and we
don't need to have a case statement with a conditional on the same
expression as the switch statement.

We do want to fall through to the common 'number()' case, but that's
trivially done by making the other case statements use 'continue'
instead of 'break'.  They are just looping back to the top, after all.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/vsprintf.c