From b54f351089036e9e8f144fb46a0ff4c54aa7fa8d Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Thu, 24 Sep 2020 08:37:02 +0200 Subject: [PATCH] Fix const correctness in buffer --- core-buffer/include/BufferUtils.hpp | 8 ++++---- core-buffer/src/BufferUtils.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core-buffer/include/BufferUtils.hpp b/core-buffer/include/BufferUtils.hpp index 5216a2d..fa02a3f 100644 --- a/core-buffer/include/BufferUtils.hpp +++ b/core-buffer/include/BufferUtils.hpp @@ -7,11 +7,11 @@ namespace BufferUtils { std::string get_filename( - std::string detector_folder, - std::string module_name, - uint64_t pulse_id); + const std::string& detector_folder, + const std::string& module_name, + const uint64_t pulse_id); - std::size_t get_file_frame_index(uint64_t pulse_id); + std::size_t get_file_frame_index(const uint64_t pulse_id); void update_latest_file( const std::string& latest_filename, diff --git a/core-buffer/src/BufferUtils.cpp b/core-buffer/src/BufferUtils.cpp index a7346aa..388c945 100644 --- a/core-buffer/src/BufferUtils.cpp +++ b/core-buffer/src/BufferUtils.cpp @@ -8,9 +8,9 @@ using namespace std; using namespace buffer_config; string BufferUtils::get_filename( - std::string detector_folder, - std::string module_name, - uint64_t pulse_id) + const std::string& detector_folder, + const std::string& module_name, + const uint64_t pulse_id) { uint64_t data_folder = pulse_id / buffer_config::FOLDER_MOD; data_folder *= buffer_config::FOLDER_MOD; @@ -27,7 +27,7 @@ string BufferUtils::get_filename( return folder.str(); } -size_t BufferUtils::get_file_frame_index(uint64_t pulse_id) +size_t BufferUtils::get_file_frame_index(const uint64_t pulse_id) { uint64_t file_base = pulse_id / buffer_config::FILE_MOD; file_base *= buffer_config::FILE_MOD;