From 608b038bddb3de524058039c88b64285f84ba774 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 1 Nov 2012 14:50:18 +0000 Subject: (Pkg_id,Pkg_setid) simplify by having a temporary variable --- URPM.xs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/URPM.xs b/URPM.xs index 0ecebaf..5169e4a 100644 --- a/URPM.xs +++ b/URPM.xs @@ -1824,16 +1824,18 @@ void Pkg_id(pkg) URPM::Package pkg PPCODE: - if ((pkg->flag & FLAG_ID) <= FLAG_ID_MAX) - mXPUSHs(newSViv(pkg->flag & FLAG_ID)); + int id = pkg->flag & FLAG_ID; + if (id <= FLAG_ID_MAX) + mXPUSHs(newSViv(id)); void Pkg_set_id(pkg, id=-1) URPM::Package pkg int id PPCODE: - if ((pkg->flag & FLAG_ID) <= FLAG_ID_MAX) - mXPUSHs(newSViv(pkg->flag & FLAG_ID)); + int old_id = pkg->flag & FLAG_ID; + if (old_id <= FLAG_ID_MAX) + mXPUSHs(newSViv(old_id)); pkg->flag &= ~FLAG_ID; pkg->flag |= id >= 0 && id <= FLAG_ID_MAX ? id : FLAG_ID_INVALID; -- cgit v1.2.1