Simplify a function

Jiergir Ogoerg f35f22fan at gmail.com
Wed Jul 24 15:51:53 PDT 2013


Hi,
I think in wayland-client.c the function
wl_display_dispatch_queue_pending(...)
could be simplified
from this:
    pthread_mutex_lock(&display->mutex);
    if (dispatch_queue(display, queue) == -1)
        goto err_unlock;
    pthread_mutex_unlock(&display->mutex);
    return 0;
 err_unlock:
    pthread_mutex_unlock(&display->mutex);
    return -1;

to this:
    int ret;
    pthread_mutex_lock(&display->mutex);
    ret = dispatch_queue(display, queue);
    pthread_mutex_unlock(&display->mutex);
    return (ret == -1) ? -1 : 0;



Just my 0.02$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130725/a7702776/attachment.html>


More information about the wayland-devel mailing list