summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_array.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2014-05-21 21:26:16 +1000
committerTimothy Arceri <[email protected]>2014-05-22 06:52:03 +1000
commit5a40a0008961ff3172f78d1a61bf3516680100e1 (patch)
treeabcf2952468a8205eba3fa5c28b5c12f2e39192f /src/mesa/vbo/vbo_exec_array.c
parentb81de5352dc8f3db01888175561b816c0d92716b (diff)
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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_exec_array.c')
-rw-r--r--src/mesa/vbo/vbo_exec_array.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 07ce08feff9..9c161ccca72 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -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 {