]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Turn 4 lines of code into 1 line that does the same thing.
authorJoshua Colp <jcolp@digium.com>
Fri, 27 Jul 2007 16:31:55 +0000 (16:31 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 27 Jul 2007 16:31:55 +0000 (16:31 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77538 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 17b07684c497ae267a8c253617ca5f658b009b3f..9500d2251ed7a978048f6a8e1f81e1d4c89ec345 100644 (file)
@@ -8974,10 +8974,7 @@ static void sip_peer_hold(struct sip_pvt *p, int hold)
                return;
 
        /* If they put someone on hold, increment the value... otherwise decrement it */
-       if (hold)
-               ast_atomic_fetchadd_int(&peer->onHold, +1);
-       else
-               ast_atomic_fetchadd_int(&peer->onHold, -1);
+       ast_atomic_fetchadd_int(&peer->onHold, (hold ? +1 : -1));
 
        /* Request device state update */
        ast_device_state_changed("SIP/%s", peer->name);