[PATCH setup 5/5] Simplify PickView::insert_pkg

Jon Turney jon.turney@dronecode.org.uk
Fri Nov 18 16:47:00 GMT 2016


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



More information about the Cygwin-apps mailing list