From 6087086f94886d848f71ad86f3c9a7363c29be7c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 4 Aug 2020 18:03:49 +0100 Subject: [PATCH] history reporting (nfc): Break out cache_row_lookup_prep Prep work. Signed-off-by: Ian Jackson --- sg-report-host-history | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sg-report-host-history b/sg-report-host-history index a8dae15..2724ef2 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -112,6 +112,16 @@ sub cache_read_existing ($) { close H; } +sub cache_row_lookup_prep ($) { + my ($jrr) = @_; + + my $cacherow = $cache{cache_row_key($$jrr)}; + if ($cacherow) { + $$jrr = $cacherow; + $cachehits++; + } +} + sub cache_write_entry ($$) { my ($fh, $jr) = @_; print $fh "