Re: [PATCH wayland] connection: remove redundant assignment
On Fri, Apr 22, 2016 at 05:46:00PM +0200, Marek Chalupa wrote: > 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 Pushed with Eric's and my RB: 7085064..85b80f5 master -> master Jonas > --- > src/connection.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/src/connection.c b/src/connection.c > index c0e322f..747229e 100644 > --- a/src/connection.c > +++ b/src/connection.c > @@ -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; > } > -- > 2.5.5 > > ___ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] connection: remove redundant assignment
On Fri, Apr 22, 2016 at 05:46:00PM +0200, Marek Chalupa wrote: > the code is something like: > Maybe add: struct wl_object *object; to your abridged version to clearly show that it's a local object? > 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 Either way, it's Reviewed-by: Eric Engestrom ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH wayland] connection: remove redundant assignment
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 --- src/connection.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/connection.c b/src/connection.c index c0e322f..747229e 100644 --- a/src/connection.c +++ b/src/connection.c @@ -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; } -- 2.5.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel