diff MoinMoin/groups/backends/__init__.py @ 4813:8ce584105581

Groups2009: BaseGroup._load_group is shortened by using difference.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Thu, 18 Jun 2009 15:09:54 +0200
parents 3c0ce322472a
children 7d8f51be2285
line wrap: on
line diff
--- a/MoinMoin/groups/backends/__init__.py	Sun Jun 14 17:23:58 2009 +0200
+++ b/MoinMoin/groups/backends/__init__.py	Thu Jun 18 15:09:54 2009 +0200
@@ -25,18 +25,14 @@
 
     def _load_group(self):
         """
-        Fill in self.members, self.member_groups with data retrieved from the backend.
+        Retrieve group data from the backend and filter it to members and group_members.
         """
-        members_final = set()
-        member_groups = set()
+        members_retrieved = set(self._backend._retrieve_members(self.name))
 
-        for member in self._backend._retrieve_members(self.name):
-            if self._backend.is_group(member):
-                member_groups.add(member)
-            else:
-                members_final.add(member)
+        member_groups = set(member for member in members_retrieved if self._backend.is_group(member))
+        members = members_retrieved - member_groups
 
-        return members_final, member_groups
+        return members, member_groups
 
     def _contains(self, member, processed_groups):
         """