From 4156d3608a032453f0aaf34bf76f0ba39a82143b Mon Sep 17 00:00:00 2001
From: Andreas Romeyke <andreas.romeyke@slub-dresden.de>
Date: Mon, 2 Jan 2023 16:51:55 +0100
Subject: [PATCH] - added a shortcut-regex to improve regex setup performance

---
 lib/SLUB/LZA/Rosetta/TA/Command/log.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/SLUB/LZA/Rosetta/TA/Command/log.pm b/lib/SLUB/LZA/Rosetta/TA/Command/log.pm
index 8953a2d..46fb77c 100644
--- a/lib/SLUB/LZA/Rosetta/TA/Command/log.pm
+++ b/lib/SLUB/LZA/Rosetta/TA/Command/log.pm
@@ -89,6 +89,9 @@ sub create_regex_last24h {
 sub create_regex_from_to {
     my $from=shift // "2000-01-01";
     my $to=shift // "2059-12-31";
+    if ($from eq "2000-01-01" and $to eq "2059-12-31") {
+        return qr{20[0-5][0-9]-[01][0-9]-[0-3][0-9]};
+    }
     my $dt_from = DateTime::Format::DateParse->parse_datetime("$from");
     my $dt_to = DateTime::Format::DateParse->parse_datetime("$to");
     my @date_tmo_s;
@@ -138,4 +141,4 @@ sub execute {
     }
 }
 
-1;
\ No newline at end of file
+1;
-- 
GitLab