fix: 修复cppCheck告警

Signed-off-by: jiangwei <jiangwei214@h-partners.com>
This commit is contained in:
jiangwei 2024-09-14 15:48:43 +08:00
parent d38b54a6b1
commit 0a4e8bb210

View File

@ -183,7 +183,7 @@ static napi_value JSTraceFinish(napi_env env, napi_callback_info info)
napi_value thisVar;
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, NULL));
NAPI_ASSERT(env, argc >= ARGC_NUMBER_TWICE, "Wrong number of arguments");
(void)JsStrNumParamsFunc(env, info, [&env] (std::string name, napi_value& nValue) -> bool {
(void)JsStrNumParamsFunc(env, info, [&env] (std::string name, const napi_value& nValue) -> bool {
int taskId = 0;
if (!ParseInt32Param(env, nValue, taskId)) {
return false;
@ -201,7 +201,7 @@ static napi_value JSTraceCount(napi_env env, napi_callback_info info)
napi_value thisVar;
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, NULL));
NAPI_ASSERT(env, argc == ARGC_NUMBER_TWICE, "Wrong number of arguments");
(void)JsStrNumParamsFunc(env, info, [&env] (std::string name, napi_value& nValue) -> bool {
(void)JsStrNumParamsFunc(env, info, [&env] (std::string name, const napi_value& nValue) -> bool {
int64_t count = 0;
if (!ParseInt64Param(env, nValue, count)) {
return false;