From: Emil Velikov <[email protected]> Drop the local variable and return directly.
Signed-off-by: Emil Velikov <[email protected]> --- src/mesa/drivers/dri/i965/intel_screen.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 4ce06c9db0a..820f0de4c7b 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -349,16 +349,12 @@ intel_image_warn_if_unaligned(__DRIimage *image, const char *func) static const struct intel_image_format * intel_image_format_lookup(int fourcc) { - const struct intel_image_format *f = NULL; - for (unsigned i = 0; i < ARRAY_SIZE(intel_image_formats); i++) { - if (intel_image_formats[i].fourcc == fourcc) { - f = &intel_image_formats[i]; - break; - } + if (intel_image_formats[i].fourcc == fourcc) + return &intel_image_formats[i]; } - return f; + return NULL; } static boolean intel_lookup_fourcc(int dri_format, int *fourcc) -- 2.13.3 _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
