mesa: check constant before null check

For most drivers this if statement is always going to fail so check the constant value first.

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Timothy Arceri 2014-05-21 21:26:16 +10:00
parent b81de5352d
commit 5a40a00089
1 changed files with 3 additions and 3 deletions

View File

@ -581,9 +581,9 @@ vbo_handle_primitive_restart(struct gl_context *ctx,
{
struct vbo_context *vbo = vbo_context(ctx);
if ((ib != NULL) &&
ctx->Const.PrimitiveRestartInSoftware &&
ctx->Array._PrimitiveRestart) {
if (ctx->Const.PrimitiveRestartInSoftware &&
ctx->Array._PrimitiveRestart &&
(ib != NULL)) {
/* Handle primitive restart in software */
vbo_sw_primitive_restart(ctx, prim, nr_prims, ib, NULL);
} else {