diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-14 14:58:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-14 14:58:07 +0200 |
commit | 263e6772cecb91cf26295c48f9ac3b0701ca4ab2 (patch) | |
tree | 4d069ab44d03f68a9ec8287518d2847697428be0 | |
parent | 21758878a3b902ba06aaf2945edc626b367f2dbd (diff) |
Simplify available_package_id comparison
-rw-r--r-- | bpkg/package.cxx | 17 |
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 |