connection: remove redundant assignment
authorMarek Chalupa <mchqwerty@gmail.com>
Fri, 22 Apr 2016 15:46:00 +0000 (17:46 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Sat, 23 Apr 2016 03:38:20 +0000 (11:38 +0800)
the code is something like:

  if (object == NULL && ...) {
      object = NULL;
      return;
  }

first, the object is already NULL, second, the assignment has no effect
since we return from the function right away

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
src/connection.c

index c0e322f..747229e 100644 (file)
@@ -838,7 +838,6 @@ wl_closure_lookup_objects(struct wl_closure *closure, struct wl_map *objects)
                        } else if (object == NULL && id != 0) {
                                wl_log("unknown object (%u), message %s(%s)\n",
                                       id, message->name, message->signature);
-                               object = NULL;
                                errno = EINVAL;
                                return -1;
                        }