From caa792897296f0b03b364ec64ce9065b010e1305 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 17 Aug 2009 03:50:04 +0200 Subject: libpulse: some minor optimizations when checking equality --- src/pulse/sample.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pulse/sample.c') diff --git a/src/pulse/sample.c b/src/pulse/sample.c index 0f19f8eb..d5d38eda 100644 --- a/src/pulse/sample.c +++ b/src/pulse/sample.c @@ -125,6 +125,10 @@ int pa_sample_spec_equal(const pa_sample_spec*a, const pa_sample_spec*b) { pa_assert(b); pa_return_val_if_fail(pa_sample_spec_valid(a), 0); + + if (PA_UNLIKELY(a == b)) + return 1; + pa_return_val_if_fail(pa_sample_spec_valid(b), 0); return -- cgit