From 3aa20e7446e150a0df8c847526c739910b45ed2e Mon Sep 17 00:00:00 2001 From: Herman Semenov Date: Thu, 15 Feb 2024 17:01:25 +0300 Subject: [PATCH] examples : constantify lambda variables --- examples/quantize-stats/quantize-stats.cpp | 2 +- examples/server/httplib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/quantize-stats/quantize-stats.cpp b/examples/quantize-stats/quantize-stats.cpp index 1d05f1391..f585972cc 100644 --- a/examples/quantize-stats/quantize-stats.cpp +++ b/examples/quantize-stats/quantize-stats.cpp @@ -183,7 +183,7 @@ static void test_roundtrip_on_layer( if (output_scratch.size() < nelements) output_scratch.resize(nelements); if (max_thread < 1) max_thread = std::thread::hardware_concurrency(); - int chunk_size = 32*512; + const int chunk_size = 32*512; int num_chunks = (nelements + chunk_size - 1)/chunk_size; if (num_chunks < 2 || max_thread < 2) { diff --git a/examples/server/httplib.h b/examples/server/httplib.h index 28746000c..74a4c1a7d 100644 --- a/examples/server/httplib.h +++ b/examples/server/httplib.h @@ -6936,7 +6936,7 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req, inline ContentProviderWithoutLength ClientImpl::get_multipart_content_provider( const std::string &boundary, const MultipartFormDataItems &items, const MultipartFormDataProviderItems &provider_items) { - size_t cur_item = 0, cur_start = 0; + const size_t cur_item = 0, cur_start = 0; // cur_item and cur_start are copied to within the std::function and maintain // state between successive calls return [&, cur_item, cur_start](size_t offset,