server: Use existing id variable when inserting created object

We already have the id variable there and it makes it slightly easier to
read.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
Jonas Ådahl 2015-01-23 16:21:15 +08:00 committed by Bryce Harrington
parent 5ce947bd90
commit ab3ee6f6d9

View file

@ -1313,11 +1313,10 @@ wl_resource_create(struct wl_client *client,
resource->version = version; resource->version = version;
resource->dispatcher = NULL; resource->dispatcher = NULL;
if (wl_map_insert_at(&client->objects, 0, resource->object.id, resource) < 0) { if (wl_map_insert_at(&client->objects, 0, id, resource) < 0) {
wl_resource_post_error(client->display_resource, wl_resource_post_error(client->display_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT, WL_DISPLAY_ERROR_INVALID_OBJECT,
"invalid new id %d", "invalid new id %d", id);
resource->object.id);
free(resource); free(resource);
return NULL; return NULL;
} }