summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2013-10-23 19:58:27 +0200
committerJulian Andres Klode <jak@debian.org>2013-10-23 19:58:27 +0200
commit9678770074e48ba947e69d9a9f2ef9688688c07f (patch)
tree69b3a448fc2d49a6534a87a0e51e4c67f6414938
parentbfe80fd22080fb33781b67157f34ea5114d3a4b2 (diff)
downloadpython-apt-9678770074e48ba947e69d9a9f2ef9688688c07f.tar.gz
python/policy.cc: (scan-build): Fix a dead assignment
We need to use else if, otherwise the first cases are not handled at all.
-rw-r--r--python/policy.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/policy.cc b/python/policy.cc
index ac9a1ace..0ace3e67 100644
--- a/python/policy.cc
+++ b/python/policy.cc
@@ -134,9 +134,9 @@ static PyObject *policy_create_pin(PyObject *self, PyObject *args) {
pkgPolicy *policy = GetCpp<pkgPolicy *>(self);
if (strcmp(type,"Version") == 0 || strcmp(type, "version") == 0)
match_type = pkgVersionMatch::Version;
- if (strcmp(type,"Release") == 0 || strcmp(type, "release") == 0)
+ else if (strcmp(type,"Release") == 0 || strcmp(type, "release") == 0)
match_type = pkgVersionMatch::Release;
- if (strcmp(type,"Origin") == 0 || strcmp(type, "origin") == 0)
+ else if (strcmp(type,"Origin") == 0 || strcmp(type, "origin") == 0)
match_type = pkgVersionMatch::Origin;
else
match_type = pkgVersionMatch::None;