From f4e0a45fad71658d362d5f40475d13a72c2736bf Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Mon, 15 Jun 2009 19:06:25 +0000 Subject: [PATCH] code optimization of eventbase filters svn: r12668 --- src/Filters/Rules/_HasEventBase.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Filters/Rules/_HasEventBase.py b/src/Filters/Rules/_HasEventBase.py index daccdba79..3c6dd760a 100644 --- a/src/Filters/Rules/_HasEventBase.py +++ b/src/Filters/Rules/_HasEventBase.py @@ -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: