修改代码规范

Signed-off-by: cwx1101045 <chenkai154@huawei.com>
This commit is contained in:
cwx1101045 2022-03-29 13:01:25 +08:00
parent 9e17f8945b
commit 84a7f0a06b
7 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,3 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

View File

@ -91,7 +91,7 @@ NVal NAsyncWorkCallback::Schedule(string procedureName, NContextCBExec cbExec, N
return NVal();
}
ctx_ = nullptr; // The ownership of ctx_ has been transfered
ctx_ = nullptr; // The ownership of ctx_ has been transferred
return NVal::CreateUndefined(env_);
}
} // namespace DistributedFS

View File

@ -69,7 +69,7 @@ bool NClass::SaveClass(napi_env env, string className, napi_value exClass)
return res == napi_ok;
}
napi_value NClass::InstantiateClass(napi_env env, string className, vector<napi_value> args)
napi_value NClass::InstantiateClass(napi_env env, string& className, vector<napi_value>& args)
{
NClass &nClass = NClass::GetInstance();
lock_guard(nClass.exClassMapLock);

View File

@ -35,7 +35,7 @@ public:
napi_callback constructor,
std::vector<napi_property_descriptor> &&properties);
static bool SaveClass(napi_env env, std::string className, napi_value exClass);
static napi_value InstantiateClass(napi_env env, std::string className, std::vector<napi_value> args);
static napi_value InstantiateClass(napi_env env, std::string& className, std::vector<napi_value>& args);
template <class T> static T *GetEntityOf(napi_env env, napi_value objStat)
{

View File

@ -188,7 +188,9 @@ bool GetFileNames(string path, vector<string> &filenames, bool rec, bool isList)
if (isList) {
filenames.push_back(path + "/" + ptr->d_name);
} else if (ptr->d_type == DT_DIR && rec) {
GetFileNames(path + "/" + ptr->d_name, filenames, rec, isList);
if(GetFileNames(path + "/" + ptr->d_name, filenames, rec, isList) == false) {
break;
}
} else if (ptr->d_type == DT_REG) {
filenames.push_back(path + "/" + ptr->d_name);
}

View File

@ -92,7 +92,7 @@ NVal NAsyncWorkCallback::Schedule(string procedureName, NContextCBExec cbExec, N
return NVal();
}
ctx_ = nullptr; // The ownership of ctx_ has been transfered
ctx_ = nullptr; // The ownership of ctx_ has been transferred
return NVal::CreateUndefined(env_);
}
} // namespace LibN

View File

@ -85,7 +85,7 @@ NVal NAsyncWorkPromise::Schedule(string procedureName, NContextCBExec cbExec, NC
return NVal();
}
ctx_ = nullptr; // The ownership of ctx_ has been transfered
ctx_ = nullptr; // The ownership of ctx_ has been transferred
return {env_, result};
}
} // namespace LibN