[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 21/60] history reporting (nfc): Rename some module variables, remove "cache"


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:26 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:27:00 +0000
  • Ironport-sdr: Ez1uaDVp3YNnZmB8o5hfowhFbk2KXYlLwJxDccw/0cocOpw8NZX3shD+l6qDoFjxPAEDwqU+21 OkEm8iHYWXcrUFUH4rnB/OVuMPs4Rs1uOwvvVz3P4ygMGUVS/J3rbpxF+jfi8t6sM3QyqCl5QP MYsEpzjII7cXrkHHFoK4hyWFWMzBZk83ag4YEeFS702AY3X//fK7BMRBNiYDFdpyOdF6FFUqvZ xjKYuJLYKaVRIMOWGYNqa2jlR0nHSbodwpe5BmlpNF/YnKLWBwhJLJM8ZEYp0PbiXTvO0faacH Nr8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This makes the code terser and easier to read.  No functional change.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/HistoryReport.pm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Osstest/HistoryReport.pm b/Osstest/HistoryReport.pm
index a0565b6a..61b1ee8f 100644
--- a/Osstest/HistoryReport.pm
+++ b/Osstest/HistoryReport.pm
@@ -40,7 +40,7 @@ BEGIN {
 
 use POSIX;
 
-our @cache_row_key_cols;
+our @key_cols;
 
 our %cache;
 
@@ -51,11 +51,11 @@ our $rows_previous = 0;
 our $rows_today = 0;
 our $rows_hit = 0;
 
-sub cache_set_key_cols { @cache_row_key_cols = @_; }
+sub cache_set_key_cols { @key_cols = @_; }
 
-sub cache_row_key ($) {
+sub key ($) {
     my ($jr) = @_;
-    return join $; , map { $jr->{$_} } @cache_row_key_cols;
+    return join $; , map { $jr->{$_} } @key_cols;
 }
 
 sub cacheable_fn ($$$) {
@@ -107,7 +107,7 @@ sub cache_read_previous ($) {
            s{\%([0-9a-f]{2})}{ chr hex $1 }ge;
            $ch->{$k} = $_;
        }
-       $cache{cache_row_key($jr)} = $jr;
+       $cache{key($jr)} = $jr;
     }
     close H;
 }
@@ -116,7 +116,7 @@ sub cache_row_lookup_prep ($) {
     my ($jrr) = @_;
 
     $rows_today++;
-    my $cacherow = $cache{cache_row_key($$jrr)};
+    my $cacherow = $cache{key($$jrr)};
     if ($cacherow) {
        $$jrr = $cacherow;
        $rows_hit++;
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.