Skip to content

Commit 1b5a83b

Browse files
authored
Merge pull request #68 from ggtakec/fix/cppcheck
Changed cppcheck options and fixed the code
2 parents 598ba2e + 1ed88f4 commit 1b5a83b

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

.github/workflows/nodejs_addon_helper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ PRNSUCCESS "Start to check options and environments"
13701370
# Default command parameters for each phase
13711371
#
13721372
CPPCHECK_TARGET="."
1373-
CPPCHECK_BASE_OPT="--quiet --error-exitcode=1 --inline-suppr -j 4 --std=c++03 --xml --enable=warning,style,information,missingInclude"
1373+
CPPCHECK_BASE_OPT="--quiet --error-exitcode=1 --inline-suppr -j 8 --std=c++14 --xml --enable=warning,style,information,missingInclude"
13741374
CPPCHECK_ENABLE_VALUES="warning style information missingInclude"
13751375
CPPCHECK_IGNORE_VALUES="unmatchedSuppression missingIncludeSystem normalCheckLevelMaxBranches"
13761376
CPPCHECK_BUILD_DIR="/tmp/cppcheck"

src/k2h_shm_async.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,7 @@ class GetValueAsyncWorker : public Napi::AsyncWorker
301301
if(sk){
302302
strarr_t strarr;
303303
sk->StringArray(strarr);
304-
for(const auto &_str : strarr){
305-
if(_str == _strsubkey){
306-
found = true;
307-
break;
308-
}
309-
}
304+
found = std::any_of(strarr.begin(), strarr.end(), [&](const auto &_str){ return _str == _strsubkey; });
310305
delete sk;
311306
}
312307
if(!found){

0 commit comments

Comments
 (0)