From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21388 invoked by alias); 18 Nov 2016 16:47:32 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 21303 invoked by uid 89); 18 Nov 2016 16:47:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.7 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=D*dronecode.org.uk, D*org.uk, sk:jontur, U*jon.turney X-HELO: rgout0707.bt.lon5.cpcloud.co.uk Received: from rgout0707.bt.lon5.cpcloud.co.uk (HELO rgout0707.bt.lon5.cpcloud.co.uk) (65.20.0.147) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Nov 2016 16:47:20 +0000 X-OWM-Source-IP: 31.51.207.247 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-Junkmail-Premium-Raw: score=7/50,refid=2.7.2:2016.11.18.160315:17:7.944,ip=,rules=__HAS_FROM, __TO_MALFORMED_2, __TO_NO_NAME, __HAS_CC_HDR, __CC_NAME, __CC_NAME_DIFF_FROM_ACC, __CP_POSSIBLE_EXPLOIT_SUBJ, __HAS_MSGID, __SANE_MSGID, __HAS_X_MAILER, __IN_REP_TO, __REFERENCES, __FROM_DOMAIN_IN_ANY_CC1, __ANY_URI, __URI_NO_WWW, __NO_HTML_TAG_RAW, BODY_SIZE_1300_1399, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, BODY_SIZE_2000_LESS, __FROM_DOMAIN_IN_RCPT, IN_REP_TO, __MIME_TEXT_P, REFERENCES, BODY_SIZE_7000_LESS, NO_URI_HTTPS, MSG_THREAD, __CC_REAL_NAMES, MULTIPLE_REAL_RCPTS, LEGITIMATE_SIGNS, LEGITIMATE_NEGATE Received: from localhost.localdomain (31.51.207.247) by rgout07.bt.lon5.cpcloud.co.uk (9.0.019.07.01-1) (authenticated as jonturney@btinternet.com) id 581B49A30198DCFA; Fri, 18 Nov 2016 16:47:18 +0000 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 5/5] Simplify PickView::insert_pkg Date: Fri, 18 Nov 2016 16:47:00 -0000 Message-Id: <20161118164646.209716-6-jon.turney@dronecode.org.uk> In-Reply-To: <20161118164646.209716-1-jon.turney@dronecode.org.uk> References: <20161118164646.209716-1-jon.turney@dronecode.org.uk> X-SW-Source: 2016-11/txt/msg00008.txt.bz2 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 --- 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 ::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