aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-10-14 14:58:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-10-14 14:58:07 +0200
commit263e6772cecb91cf26295c48f9ac3b0701ca4ab2 (patch)
tree4d069ab44d03f68a9ec8287518d2847697428be0
parent21758878a3b902ba06aaf2945edc626b367f2dbd (diff)
Simplify available_package_id comparison
-rw-r--r--bpkg/package.cxx17
1 files changed, 1 insertions, 16 deletions
diff --git a/bpkg/package.cxx b/bpkg/package.cxx
index 2612cbe..064dadd 100644
--- a/bpkg/package.cxx
+++ b/bpkg/package.cxx
@@ -19,22 +19,7 @@ namespace bpkg
operator< (const available_package_id& x, const available_package_id& y)
{
int r (x.name.compare (y.name));
-
- if (r != 0)
- return r < 0;
-
- const auto& xv (x.version);
- const auto& yv (y.version);
-
- if (xv.epoch != yv.epoch)
- return xv.epoch < yv.epoch;
-
- r = xv.canonical_upstream.compare (yv.canonical_upstream);
-
- if (r != 0)
- return r < 0;
-
- return xv.revision < yv.revision;
+ return r != 0 ? r < 0 : x.version < y.version;
}
// available_package