This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH setup 5/5] Simplify PickView::insert_pkg
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: cygwin-apps at cygwin dot com
- Cc: Jon Turney <jon dot turney at dronecode dot org dot uk>
- Date: Fri, 18 Nov 2016 16:46:46 +0000
- Subject: [PATCH setup 5/5] Simplify PickView::insert_pkg
- Authentication-results: sourceware.org; auth=none
- References: <20161118164646.209716-1-jon.turney@dronecode.org.uk>
This is only called from PickView::setViewMode(), and only when view_style
is not viewStyles::Category, so checking that is redundant.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
PickView.cc | 26 +++-----------------------
1 file changed, 3 insertions(+), 23 deletions(-)
diff --git a/PickView.cc b/PickView.cc
index fc6f8c2..3de49f7 100644
--- a/PickView.cc
+++ b/PickView.cc
@@ -278,29 +278,9 @@ PickView::insert_pkg (packagemeta & pkg)
{
if (!showObsolete && isObsolete (pkg.categories))
return;
-
- if (view_mode != views::Category)
- {
- PickLine & line = *new PickPackageLine (*this, pkg);
- contents.insert (line);
- }
- else
- {
- for (set <std::string, casecompare_lt_op>::const_iterator x
- = pkg.categories.begin (); x != pkg.categories.end (); ++x)
- {
- // Special case - yuck
- if (casecompare(*x, "All") == 0)
- continue;
-
- packagedb db;
- PickCategoryLine & catline =
- *new PickCategoryLine (*this, *db.categories.find (*x), 1);
- PickLine & line = *new PickPackageLine(*this, pkg);
- catline.insert (line);
- contents.insert (catline);
- }
- }
+
+ PickLine & line = *new PickPackageLine (*this, pkg);
+ contents.insert (line);
}
void
--
2.8.3