diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-11-01 14:50:18 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-11-01 14:50:18 +0000 |
commit | 608b038bddb3de524058039c88b64285f84ba774 (patch) | |
tree | 68e5c35ede113726c406c2969d6f7f4098bdde20 | |
parent | b10406e38b62bbe9eab737dc0e755d55c8965913 (diff) | |
download | perl-URPM-608b038bddb3de524058039c88b64285f84ba774.tar perl-URPM-608b038bddb3de524058039c88b64285f84ba774.tar.gz perl-URPM-608b038bddb3de524058039c88b64285f84ba774.tar.bz2 perl-URPM-608b038bddb3de524058039c88b64285f84ba774.tar.xz perl-URPM-608b038bddb3de524058039c88b64285f84ba774.zip |
(Pkg_id,Pkg_setid) simplify by having a temporary variable
-rw-r--r-- | URPM.xs | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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; |