mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
timeval: add UNLIKELY annotation
This commit is contained in:
parent
05f6236a83
commit
a1da83b206
1 changed files with 3 additions and 3 deletions
|
|
@ -83,7 +83,7 @@ pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b) {
|
||||||
pa_assert(b);
|
pa_assert(b);
|
||||||
|
|
||||||
/* Check which whan is the earlier time and swap the two arguments if required. */
|
/* Check which whan is the earlier time and swap the two arguments if required. */
|
||||||
if (pa_timeval_cmp(a, b) < 0) {
|
if (PA_UNLIKELY(pa_timeval_cmp(a, b) < 0)) {
|
||||||
const struct timeval *c;
|
const struct timeval *c;
|
||||||
c = a;
|
c = a;
|
||||||
a = b;
|
a = b;
|
||||||
|
|
@ -95,9 +95,9 @@ pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b) {
|
||||||
|
|
||||||
/* Calculate the microsecond difference */
|
/* Calculate the microsecond difference */
|
||||||
if (a->tv_usec > b->tv_usec)
|
if (a->tv_usec > b->tv_usec)
|
||||||
r += ((pa_usec_t) a->tv_usec - (pa_usec_t) b->tv_usec);
|
r += (pa_usec_t) a->tv_usec - (pa_usec_t) b->tv_usec;
|
||||||
else if (a->tv_usec < b->tv_usec)
|
else if (a->tv_usec < b->tv_usec)
|
||||||
r -= ((pa_usec_t) b->tv_usec - (pa_usec_t) a->tv_usec);
|
r -= (pa_usec_t) b->tv_usec - (pa_usec_t) a->tv_usec;
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue