mesa/main: simplify _mesa_IsRenderbuffer()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 6 Apr 2017 16:05:36 +0000 (18:05 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 6 Apr 2017 22:48:01 +0000 (00:48 +0200)
_mesa_lookup_renderbuffer() already checks if 'id' is non-zero.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/fbobject.c

index 5048327e5ed3c1f7c058e89b80bfb00794cf8448..3289f86803cc2414e5db521a5637bc4a2282c55a 100644 (file)
@@ -1297,15 +1297,14 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
 GLboolean GLAPIENTRY
 _mesa_IsRenderbuffer(GLuint renderbuffer)
 {
+   struct gl_renderbuffer *rb;
+
    GET_CURRENT_CONTEXT(ctx);
+
    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
-   if (renderbuffer) {
-      struct gl_renderbuffer *rb =
-         _mesa_lookup_renderbuffer(ctx, renderbuffer);
-      if (rb != NULL && rb != &DummyRenderbuffer)
-         return GL_TRUE;
-   }
-   return GL_FALSE;
+
+   rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
+   return rb != NULL && rb != &DummyRenderbuffer;
 }