summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-18 04:11:02 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-18 04:14:38 +0200
commita1da83b206d4a73bfa537ab3694bac7244bd19a1 (patch)
treebcd291723e3f7d9cda7101ed472d25672b132d0e /src
parent05f6236a83414573587c73dbc439e68dae5f529e (diff)
timeval: add UNLIKELY annotation
Diffstat (limited to 'src')
-rw-r--r--src/pulse/timeval.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pulse/timeval.c b/src/pulse/timeval.c
index 1a0d3cef..87569cf1 100644
--- a/src/pulse/timeval.c
+++ b/src/pulse/timeval.c
@@ -83,7 +83,7 @@ pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b) {
pa_assert(b);
/* 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;
c = a;
a = b;
@@ -95,9 +95,9 @@ pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b) {
/* Calculate the microsecond difference */
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)
- 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;
}