mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-07 23:59:22 +03:00
Use single args vector and clear before insertion
This commit is contained in:
parent
6dcbdfbf55
commit
98c8525bdd
@ -105,7 +105,7 @@ bool Native::Execute(const CefString& name,
|
||||
char * const paths[] = {rootPath, NULL};
|
||||
|
||||
CefRefPtr<CefV8Value> function = arguments[1];
|
||||
|
||||
CefV8ValueList args;
|
||||
FTS *tree = fts_open(paths, FTS_NOCHDIR | FTS_NOSTAT, NULL);
|
||||
if (tree != NULL) {
|
||||
FTSENT *entry;
|
||||
@ -113,11 +113,11 @@ bool Native::Execute(const CefString& name,
|
||||
if (entry->fts_level == 0)
|
||||
continue;
|
||||
if ((entry->fts_info & FTS_D) != 0 || (entry->fts_info & FTS_F) != 0) {
|
||||
CefV8ValueList args;
|
||||
int pathLength = entry->fts_pathlen - rootPathLength;
|
||||
char relative[pathLength + 1];
|
||||
relative[pathLength] = '\0';
|
||||
strncpy(relative, entry->fts_path + rootPathLength, pathLength);
|
||||
args.clear();
|
||||
args.push_back(CefV8Value::CreateString(relative));
|
||||
args.push_back(CefV8Value::CreateBool((entry->fts_info & FTS_F) != 0));
|
||||
if (!function->ExecuteFunction(function, args)->GetBoolValue())
|
||||
|
Loading…
Reference in New Issue
Block a user