* src/GenericFilter.py: implement short-circuit if only rule is
Everyone * src/NameDisplay.py: optimization * src/PeopleModel.py: optimization of data building svn: r5810
This commit is contained in:
@@ -94,6 +94,9 @@ class Rule:
|
||||
|
||||
def __init__(self,list):
|
||||
self.set_list(list)
|
||||
|
||||
def is_empty(self):
|
||||
return False
|
||||
|
||||
def prepare(self,db):
|
||||
pass
|
||||
@@ -136,6 +139,9 @@ class Everyone(Rule):
|
||||
category = _('General filters')
|
||||
description = _('Matches everyone in the database')
|
||||
|
||||
def is_empty(self):
|
||||
return True
|
||||
|
||||
def apply(self,db,person):
|
||||
return True
|
||||
|
||||
@@ -1902,6 +1908,9 @@ class GenericFilter:
|
||||
self.logical_op = 'and'
|
||||
self.invert = False
|
||||
|
||||
def is_empty(self):
|
||||
return len(self.flist) == 1 and self.flist[0].is_empty()
|
||||
|
||||
def set_logical_op(self,val):
|
||||
if val in GenericFilter.logical_functions:
|
||||
self.logical_op = val
|
||||
|
Reference in New Issue
Block a user