From 23f9f6b1247916d41cb73db04723eb9bf7ed41e6 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 8 Mar 2013 15:37:09 -0500 Subject: [PATCH] everyone hates goto ... BE GONE! Signed-off-by: Mike Rylander --- .../OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm index 2a80d50ed1..18543b6ede 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm @@ -969,9 +969,6 @@ sub toSQL { my $cdate = $self->find_filter($datefilter); if ($cdate && $cdate->args && scalar(@{$cdate->args}) > 0 && scalar(@{$cdate->args}) < 3) { my ($cstart, $cend) = @{$cdate->args}; - my $restarted = 0; - - RESTART: if (!$cstart and !$cend) { # useless use of filter @@ -995,15 +992,10 @@ sub toSQL { AND bre.$datefilter >= \$_$$\$$cstart\$_$$\$ SQL } - } elsif (!$cend or $cend eq 'infinity') { # both supplied - if (!$restarted) { - $cstart = cleanse_ISO8601($cstart); - $cend = cleanse_ISO8601($cend); - $restarted = 1; - goto RESTART; - } - + } else { # both supplied # "between $cstart and $cend" + $cstart = cleanse_ISO8601($cstart); + $cend = cleanse_ISO8601($cend); $limit_where .= <<" SQL"; AND bre.$datefilter BETWEEN \$_$$\$$cstart\$_$$\$ AND \$_$$\$$cend\$_$$\$ SQL -- 2.11.0