From 212ad6cf8badf6443e243055c8f06fd2fc26fe74 Mon Sep 17 00:00:00 2001 From: JustKidding Date: Sat, 5 Aug 2023 16:46:58 -0500 Subject: [PATCH] remove ranges header --- src/canvas/iterm2/iterm2.cpp | 10 +++++----- src/canvas/iterm2/iterm2.hpp | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/canvas/iterm2/iterm2.cpp b/src/canvas/iterm2/iterm2.cpp index 8a436ed..3c4e7f0 100644 --- a/src/canvas/iterm2/iterm2.cpp +++ b/src/canvas/iterm2/iterm2.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -92,13 +92,13 @@ void Iterm2::draw() str.clear(); } -auto Iterm2::process_chunks(const std::string_view filename, int chunk_size, size_t num_bytes) -> std::vector> +auto Iterm2::process_chunks(const std::string& filename, int chunk_size, size_t num_bytes) -> std::vector> { const int num_chunks = std::ceil(static_cast(num_bytes) / chunk_size); std::vector> chunks; chunks.reserve(num_chunks + 2); - std::ifstream ifs (filename.data()); + std::ifstream ifs (filename); while (ifs.good()) { auto chunk = std::make_unique(chunk_size); ifs.read(chunk->get_buffer(), chunk_size); @@ -107,9 +107,9 @@ auto Iterm2::process_chunks(const std::string_view filename, int chunk_size, siz } #ifdef HAVE_STD_EXECUTION_H - std::for_each(std::execution::par_unseq, std::begin(chunks), std::end(chunks), Iterm2Chunk::process_chunk); + std::for_each(std::execution::par_unseq, chunks.begin(), chunks.end(), Iterm2Chunk::process_chunk); #else - oneapi::tbb::parallel_for_each(std::begin(chunks), std::end(chunks), Iterm2Chunk()); + oneapi::tbb::parallel_for_each(chunks.begin(), chunks.end(), Iterm2Chunk()); #endif return chunks; diff --git a/src/canvas/iterm2/iterm2.hpp b/src/canvas/iterm2/iterm2.hpp index adc217f..6749900 100644 --- a/src/canvas/iterm2/iterm2.hpp +++ b/src/canvas/iterm2/iterm2.hpp @@ -22,7 +22,6 @@ #include #include #include -#include class Iterm2Chunk; class Image; @@ -45,7 +44,7 @@ class Iterm2 : public Window int horizontal_cells = 0; int vertical_cells = 0; - static auto process_chunks(std::string_view filename, int chunk_size, size_t num_bytes) -> std::vector>; + static auto process_chunks(const std::string& filename, int chunk_size, size_t num_bytes) -> std::vector>; }; #endif