Use slice instead of startwith in stack_* incremental processing.
authorZac Medico <zmedico@gentoo.org>
Sat, 7 Mar 2009 22:27:25 +0000 (22:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 7 Mar 2009 22:27:25 +0000 (22:27 -0000)
svn path=/main/trunk/; revision=12779

pym/portage/util.py

index 5624b52868aaee82d7d3ef1be59391c03d2c249d..d5c7955fc7c2d04c1b6ac6598ff74dcd16d9b6e9 100644 (file)
@@ -177,7 +177,7 @@ def stack_dictlist(original_dicts, incremental=0, incrementals=[], ignore_none=0
                                                if thing == "-*":
                                                        final_dict[y] = []
                                                        continue
-                                               elif thing.startswith("-"):
+                                               elif thing[:1] == '-':
                                                        try:
                                                                final_dict[y].remove(thing[1:])
                                                        except ValueError:
@@ -223,7 +223,7 @@ def stack_lists(lists, incremental=1):
                        if incremental:
                                if y == "-*":
                                        new_list.clear()
-                               elif y.startswith("-"):
+                               elif y[:1] == '-':
                                        new_list.pop(y[1:], None)
                                else:
                                        new_list[y] = True