[otrs-cvs] otrs/Kernel/System/ProcessManagement Transition.pm, 1.7, 1.8
"CVS commits notifications of OTRS.org" <[email protected]>
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/otrs/Kernel/System/ProcessManagement
In directory lancelot:/tmp/cvs-serv19395/Kernel/System/ProcessManagement
Modified Files:
Transition.pm
Log Message:
Increased performance by Pre-compiling plain text Regexp.
Author: cr
Index: Transition.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/ProcessManagement/Transition.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -2 -u -d -r1.7 -r1.8
--- Transition.pm 11 Jan 2013 17:28:08 -0000 1.7
+++ Transition.pm 11 Jan 2013 18:15:29 -0000 1.8
@@ -521,4 +521,24 @@
}
+ # precompile Regexp if is a string
+ if ( ref $ActualCondition->{Fields}{$Field}{Match} eq '' ) {
+ my $Match = $ActualCondition->{Fields}{$Field}{Match};
+
+ # check for Regexp validity
+ eval {
+ qr{$Match};
+ };
+ if ($@) {
+ $Self->{LogObject}->Log(
+ Priority => 'error',
+ Message => $@,
+ );
+ return;
+
+ }
+
+ $ActualCondition->{Fields}{$Field}{Match} = qr{$Match};
+ }
+
# make sure the data string is here
# and it is of ref Regexp
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log