From 16033bd275ae214e9feb510cea058e22e801303b Mon Sep 17 00:00:00 2001 From: LTLA Date: Wed, 5 Feb 2025 10:15:36 -0800 Subject: [PATCH] Use full form for lambdas and canonical forms for IIFEs. This more easily distinguishes the declaration versus invocation of a lambda. --- include/tatami_chunked/SlabCacheStats.hpp | 2 +- include/tatami_chunked/custom_internals.hpp | 32 ++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/tatami_chunked/SlabCacheStats.hpp b/include/tatami_chunked/SlabCacheStats.hpp index 4842aaf..e53ace8 100644 --- a/include/tatami_chunked/SlabCacheStats.hpp +++ b/include/tatami_chunked/SlabCacheStats.hpp @@ -60,7 +60,7 @@ struct SlabCacheStats { */ SlabCacheStats(size_t target_length, size_t non_target_length, size_t target_num_slabs, size_t cache_size_in_bytes, size_t element_size, bool require_minimum_cache) : slab_size_in_elements(target_length * non_target_length), - max_slabs_in_cache([&]() { + max_slabs_in_cache([&]{ if (element_size == 0) { return target_num_slabs; } else { diff --git a/include/tatami_chunked/custom_internals.hpp b/include/tatami_chunked/custom_internals.hpp index 9ad3d0c..2812212 100644 --- a/include/tatami_chunked/custom_internals.hpp +++ b/include/tatami_chunked/custom_internals.hpp @@ -289,7 +289,7 @@ class ChunkCoordinator { extract_secondary_block( row, chunk_id, secondary_block_start, secondary_block_length, - [&](const Chunk_& chunk, Index_ from, Index_ len, Index_ secondary_start_pos) { + [&](const Chunk_& chunk, Index_ from, Index_ len, Index_ secondary_start_pos) -> void { auto& tmp_values = tmp_work.get_values(); auto& tmp_indices = tmp_work.get_indices(); auto& tmp_number = tmp_work.get_number(); @@ -318,7 +318,7 @@ class ChunkCoordinator { extract_secondary_block( row, chunk_id, secondary_block_start, secondary_block_length, - [&](const Chunk_& chunk, Index_ from, Index_ len) { + [&](const Chunk_& chunk, Index_ from, Index_ len) -> void { if constexpr(Chunk_::use_subset) { chunk.extract(row, chunk_offset, 1, from, len, chunk_workspace, tmp_buffer_ptr, len); } else { @@ -358,7 +358,7 @@ class ChunkCoordinator { extract_secondary_index( row, chunk_id, secondary_indices, chunk_indices_buffer, - [&](const Chunk_& chunk, const std::vector& chunk_indices, Index_ secondary_start_pos) { + [&](const Chunk_& chunk, const std::vector& chunk_indices, Index_ secondary_start_pos) -> void { auto& tmp_values = tmp_work.get_values(); auto& tmp_indices = tmp_work.get_indices(); auto& tmp_number = tmp_work.get_number(); @@ -387,7 +387,7 @@ class ChunkCoordinator { extract_secondary_index( row, chunk_id, secondary_indices, chunk_indices_buffer, - [&](const Chunk_& chunk, const std::vector& chunk_indices) { + [&](const Chunk_& chunk, const std::vector& chunk_indices) -> void { size_t nidx = chunk_indices.size(); if constexpr(Chunk_::use_subset) { chunk.extract(row, chunk_offset, 1, chunk_indices, chunk_workspace, tmp_buffer_ptr, nidx); @@ -422,7 +422,7 @@ class ChunkCoordinator { extract_secondary_block( row, chunk_id, secondary_block_start, secondary_block_length, - [&](const Chunk_& chunk, Index_ from, Index_ len, Index_ secondary_start_pos) { + [&](const Chunk_& chunk, Index_ from, Index_ len, Index_ secondary_start_pos) -> void { if constexpr(Chunk_::use_subset) { chunk.extract(row, chunk_offset, chunk_length, from, len, chunk_workspace, slab.values, slab.indices, slab.number, secondary_start_pos); } else { @@ -437,7 +437,7 @@ class ChunkCoordinator { extract_secondary_block( row, chunk_id, secondary_block_start, secondary_block_length, - [&](const Chunk_& chunk, Index_ from, Index_ len) { + [&](const Chunk_& chunk, Index_ from, Index_ len) -> void { if constexpr(Chunk_::use_subset) { chunk.extract(row, chunk_offset, chunk_length, from, len, chunk_workspace, slab_ptr, stride); } else { @@ -465,7 +465,7 @@ class ChunkCoordinator { extract_secondary_index( row, chunk_id, secondary_indices, chunk_indices_buffer, - [&](const Chunk_& chunk, const std::vector& chunk_indices, Index_ secondary_start_pos) { + [&](const Chunk_& chunk, const std::vector& chunk_indices, Index_ secondary_start_pos) -> void { if constexpr(Chunk_::use_subset) { chunk.extract(row, chunk_offset, chunk_length, chunk_indices, chunk_workspace, slab.values, slab.indices, slab.number, secondary_start_pos); } else { @@ -480,7 +480,7 @@ class ChunkCoordinator { extract_secondary_index( row, chunk_id, secondary_indices, chunk_indices_buffer, - [&](const Chunk_& chunk, const std::vector& chunk_indices) { + [&](const Chunk_& chunk, const std::vector& chunk_indices) -> void { if constexpr(Chunk_::use_subset) { chunk.extract(row, chunk_offset, chunk_length, chunk_indices, chunk_workspace, slab_ptr, stride); } else { @@ -508,7 +508,7 @@ class ChunkCoordinator { extract_secondary_block( row, chunk_id, secondary_block_start, secondary_block_length, - [&](const Chunk_& chunk, Index_ from, Index_ len, Index_ secondary_start_pos) { + [&](const Chunk_& chunk, Index_ from, Index_ len, Index_ secondary_start_pos) -> void { if constexpr(Chunk_::use_subset) { chunk.extract(row, primary_indices, from, len, chunk_workspace, slab.values, slab.indices, slab.number, secondary_start_pos); } else { @@ -523,7 +523,7 @@ class ChunkCoordinator { extract_secondary_block( row, chunk_id, secondary_block_start, secondary_block_length, - [&](const Chunk_& chunk, Index_ from, Index_ len) { + [&](const Chunk_& chunk, Index_ from, Index_ len) -> void { if constexpr(Chunk_::use_subset) { chunk.extract(row, primary_indices, from, len, chunk_workspace, slab_ptr, stride); } else { @@ -550,7 +550,7 @@ class ChunkCoordinator { extract_secondary_index( row, chunk_id, secondary_indices, chunk_indices_buffer, - [&](const Chunk_& chunk, const std::vector& chunk_indices, Index_ secondary_start_pos) { + [&](const Chunk_& chunk, const std::vector& chunk_indices, Index_ secondary_start_pos) -> void { if constexpr(Chunk_::use_subset) { chunk.extract(row, primary_indices, chunk_indices, chunk_workspace, slab.values, slab.indices, slab.number, secondary_start_pos); } else { @@ -565,7 +565,7 @@ class ChunkCoordinator { extract_secondary_index( row, chunk_id, secondary_indices, chunk_indices_buffer, - [&](const Chunk_& chunk, const std::vector& chunk_indices) { + [&](const Chunk_& chunk, const std::vector& chunk_indices) -> void { if constexpr(Chunk_::use_subset) { chunk.extract(row, primary_indices, chunk_indices, chunk_workspace, slab_ptr, stride); } else { @@ -698,10 +698,10 @@ class ChunkCoordinator { row, cache, factory, - [&](Index_ pid, Index_ pstart, Index_ plen, Slab& slab) { + [&](Index_ pid, Index_ pstart, Index_ plen, Slab& slab) -> void { fetch_block(row, pid, pstart, plen, block_start, block_length, slab, chunk_workspace); }, - [&](Index_ pid, const std::vector& pindices, Slab& slab) { + [&](Index_ pid, const std::vector& pindices, Slab& slab) -> void { fetch_index(row, pid, pindices, block_start, block_length, slab, chunk_workspace); } ); @@ -720,10 +720,10 @@ class ChunkCoordinator { row, cache, factory, - [&](Index_ pid, Index_ pstart, Index_ plen, Slab& slab) { + [&](Index_ pid, Index_ pstart, Index_ plen, Slab& slab) -> void { fetch_block(row, pid, pstart, plen, indices, chunk_indices_buffer, slab, chunk_workspace); }, - [&](Index_ pid, const std::vector& pindices, Slab& slab) { + [&](Index_ pid, const std::vector& pindices, Slab& slab) -> void { fetch_index(row, pid, pindices, indices, chunk_indices_buffer, slab, chunk_workspace); } );