code optimization of eventbase filters
svn: r12668
This commit is contained in:
parent
38876a32a5
commit
f4e0a45fad
@ -56,7 +56,8 @@ class HasEventBase(Rule):
|
||||
def prepare(self, db):
|
||||
self.date = None
|
||||
if self.list[0]:
|
||||
self.etype = self.list[0]
|
||||
self.etype = EventType()
|
||||
self.etype.set_from_xml_str(self.list[0])
|
||||
else:
|
||||
self.etype = None
|
||||
try:
|
||||
@ -66,9 +67,7 @@ class HasEventBase(Rule):
|
||||
|
||||
def apply(self, db, event):
|
||||
if self.etype:
|
||||
specified_type = EventType()
|
||||
specified_type.set_from_xml_str(self.etype)
|
||||
if event.type != specified_type:
|
||||
if event.type != self.etype:
|
||||
return False
|
||||
if self.list[3] and event.get_description().upper().find(
|
||||
self.list[3].upper())==-1:
|
||||
|
Loading…
Reference in New Issue
Block a user