1 |
From e37f14b9a63e39b344955e7bc79ffe4262e93811 Mon Sep 17 00:00:00 2001 |
2 |
From: Robert <rspier@pobox.com> |
3 |
Date: Sun, 9 May 2010 22:45:59 -0700 |
4 |
Subject: microoptimizations - replace regex with lc eq |
5 |
|
6 |
--- |
7 |
plugins/check_bogus_bounce | 8 ++++---- |
8 |
1 files changed, 4 insertions(+), 4 deletions(-) |
9 |
|
10 |
diff --git a/plugins/check_bogus_bounce b/plugins/check_bogus_bounce |
11 |
index 045889c..968f1c6 100644 |
12 |
--- a/plugins/check_bogus_bounce |
13 |
+++ b/plugins/check_bogus_bounce |
14 |
@@ -88,7 +88,7 @@ sub hook_data_post { |
15 |
# Find the sender, and return unless it wasn't a bounce. |
16 |
# |
17 |
my $sender = $transaction->sender->address || undef; |
18 |
- return DECLINED unless ($sender =~ /^<>$/); |
19 |
+ return DECLINED unless ($sender eq "<>"); |
20 |
|
21 |
# |
22 |
# Get the recipients. |
23 |
@@ -102,15 +102,15 @@ sub hook_data_post { |
24 |
# 1. It is a bounce, via the null-envelope. |
25 |
# 2. It is a bogus bounce, because there are more than one recipients. |
26 |
# |
27 |
- if ($self->{_action} =~ /^log$/i) { |
28 |
+ if (lc $self->{_action} eq "log") { |
29 |
$self->log(LOGWARN, |
30 |
$self->plugin_name() . " bogus bounce for :" . join(",", @to)); |
31 |
} |
32 |
- elsif ($self->{_action} =~ /^deny$/i) { |
33 |
+ elsif (lc $self->{_action} eq "deny") { |
34 |
return (DENY, |
35 |
$self->plugin_name() . " determined this to be a bogus bounce"); |
36 |
} |
37 |
- elsif ($self->{_action} =~ /^denysoft$/i) { |
38 |
+ elsif (lc $self->{_action} eq "denysoft") { |
39 |
return (DENYSOFT, |
40 |
$self->plugin_name() . " determined this to be a bogus bounce"); |
41 |
} |
42 |
-- |
43 |
1.7.2.2 |
44 |
|