From b3e6ef964fe36ed32cafdde02fee8c92e6ecfbf3 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Thu, 18 Apr 2024 10:41:35 +0200 Subject: [PATCH] util: simplify loop logic in util_format_get_first_non_void_channel() Part-of: --- src/util/format/u_format.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/util/format/u_format.h b/src/util/format/u_format.h index 4c64d414395..00d3e75e5a0 100644 --- a/src/util/format/u_format.h +++ b/src/util/format/u_format.h @@ -1556,12 +1556,9 @@ util_format_get_first_non_void_channel(enum pipe_format format) for (i = 0; i < 4; i++) if (desc->channel[i].type != UTIL_FORMAT_TYPE_VOID) - break; + return i; - if (i == 4) - return -1; - - return i; + return -1; } /**