Skip to content

Commit 3406526

Browse files
authored
chore: nit in layouts/chunked/reader.rs (#1926)
1 parent c5a8e20 commit 3406526

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

vortex-layout/src/layouts/chunked/reader.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,12 @@ impl ChunkedReader {
6060
pub(crate) async fn stats_table(&self) -> VortexResult<Option<&StatsTable>> {
6161
self.stats_table
6262
.get_or_try_init(async {
63-
// The number of chunks
64-
let mut nchunks = self.layout.nchildren();
65-
if self.layout.metadata().is_some() {
66-
// The final child is the statistics table.
67-
nchunks -= 1;
68-
}
69-
7063
Ok(match self.layout.metadata() {
7164
None => None,
7265
Some(metadata) => {
66+
// The final child is the statistics table.
67+
let nchunks = self.layout.nchildren() - 1;
68+
7369
// Figure out which stats are present
7470
let present_stats: Arc<[Stat]> =
7571
Arc::from(stats_from_bitset_bytes(metadata.as_ref()));

0 commit comments

Comments
 (0)