From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH setup 5/5] Simplify PickView::insert_pkg
Date: Fri, 18 Nov 2016 16:47:00 -0000 [thread overview]
Message-ID: <20161118164646.209716-6-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2016-11-18 16:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 16:47 [PATCH setup 0/5] Various setup patches Jon Turney
2016-11-18 16:47 ` [PATCH setup 3/5] Ignore malformed lines in a site-list Jon Turney
2016-11-18 16:47 ` [PATCH setup 2/5] Fix validation in RootPage Jon Turney
2016-11-18 16:47 ` [PATCH setup 4/5] Start chooser in "Pending" view if this is not a first time installation Jon Turney
2016-11-18 16:47 ` [PATCH setup 1/5] Give search edit box autohscroll style Jon Turney
2016-11-18 16:47 ` Jon Turney [this message]
2016-11-19 16:10 ` [PATCH setup 0/5] Various setup patches Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161118164646.209716-6-jon.turney@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=cygwin-apps@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).