summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-02-28 22:33:48 +1030
committerAndrew Jeffery <andrew@aj.id.au>2018-03-24 13:59:32 +1030
commitcd928513e21f02ebca1f68a414f5347a7de8326d (patch)
tree6e9ca7175c8f2f418bcf3eb54b1738edd37e8dcb
parent2ceba89ab21441364fc50d1abf41a4f1c6f68224 (diff)
downloadphosphor-mboxd-cd928513e21f02ebca1f68a414f5347a7de8326d.zip
phosphor-mboxd-cd928513e21f02ebca1f68a414f5347a7de8326d.tar.gz
pnor_partition_table: Improve readability of Table::partition(size_t)
Create a local variable for the partition of interest. Change-Id: I7c0ec008f8b616cec15f10664afca73736324029 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r--pnor_partition_table.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/pnor_partition_table.cpp b/pnor_partition_table.cpp
index a679517..c9ef3a3 100644
--- a/pnor_partition_table.cpp
+++ b/pnor_partition_table.cpp
@@ -143,11 +143,11 @@ const pnor_partition& Table::partition(size_t offset) const
for (decltype(numParts) i{}; i < numParts; ++i)
{
- if ((blockOffset >= table.partitions[i].data.base) &&
- (blockOffset <
- (table.partitions[i].data.base + table.partitions[i].data.size)))
+ const struct pnor_partition& part = table.partitions[i];
+ if ((blockOffset >= part.data.base) &&
+ (blockOffset < (part.data.base + part.data.size)))
{
- return table.partitions[i];
+ return part;
}
}
OpenPOWER on IntegriCloud