diff options
author | Sven Gothel <[email protected]> | 2022-11-27 17:23:45 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-11-27 17:23:45 +0100 |
commit | 9160f9a4b74f5e5ae07f715025ea4d3aafdf6ab3 (patch) | |
tree | d193d3a6b75d081d21d2091f44d7547eb0d9e9e3 /test/test_mm_sc_drf_01.cpp | |
parent | 2ec818d6c5cb8bebde5845827c9f0939506efc6e (diff) |
clang-tidy: Add 'performance-' fixes
- Drop 'std::move' for trivially copyable things
- Use 'const T&' if not moved into and used as R value only
- Notable: Can also hold a default value!
- Use non-const local vars, if used as return or move value
Diffstat (limited to 'test/test_mm_sc_drf_01.cpp')
-rw-r--r-- | test/test_mm_sc_drf_01.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_mm_sc_drf_01.cpp b/test/test_mm_sc_drf_01.cpp index b106d85..478034a 100644 --- a/test/test_mm_sc_drf_01.cpp +++ b/test/test_mm_sc_drf_01.cpp @@ -85,7 +85,7 @@ class TestMemModelSCDRF01 { cvRead.notify_all(); // notify waiting getter } } - void getThreadType01(const std::string msg, int _len, int startValue) { + void getThreadType01(const std::string& msg, int _len, int startValue) { const int len = std::min(number(array_size), _len); std::unique_lock<std::mutex> lock(mtx_value); // SC-DRF acquire and release @ scope exit @@ -117,7 +117,7 @@ class TestMemModelSCDRF01 { cvRead.notify_all(); } } - void getThreadType11(const std::string msg, int _idx) { + void getThreadType11(const std::string& msg, int _idx) { const int idx = std::min(number(array_size)-1, _idx); // idx is encoded on sync_value (v) as follows |