|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [OSSTEST PATCH 39/60] history reporting (nfc): Make cacheable_fn work without cache
This would allow us to use this in call sites without a cache.
I changed my mind about the code that prompted this, but it still
seems plausibly useful, so I'm keeping this commit.
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
Osstest/HistoryReport.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/Osstest/HistoryReport.pm b/Osstest/HistoryReport.pm
index 695d744a..5d2c83b7 100644
--- a/Osstest/HistoryReport.pm
+++ b/Osstest/HistoryReport.pm
@@ -99,6 +99,7 @@ sub key ($) {
sub cacheable_fn ($$$) {
my ($jr, $cachekey, $fn) = @_;
+ return $fn->() if !defined $cachekey;
$cachekey = '%'.$cachekey;
my $cached = $jr->{$cachekey};
$q_count{$cachekey}++;
--
2.11.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |