aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-11-01 14:50:18 +0000
committerThierry Vignaud <tv@mageia.org>2012-11-01 14:50:18 +0000
commit608b038bddb3de524058039c88b64285f84ba774 (patch)
tree68e5c35ede113726c406c2969d6f7f4098bdde20
parentb10406e38b62bbe9eab737dc0e755d55c8965913 (diff)
downloadperl-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.xs10
1 files 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;