aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
Diffstat (limited to 'URPM.xs')
-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;