From 98c8525bdd8dedef4ca872872b79a89b5caf8465 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 8 Oct 2012 20:46:44 -0700 Subject: [PATCH] Use single args vector and clear before insertion --- native/v8_extensions/native.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/v8_extensions/native.mm b/native/v8_extensions/native.mm index 6ad722377..7d277b9f7 100644 --- a/native/v8_extensions/native.mm +++ b/native/v8_extensions/native.mm @@ -105,7 +105,7 @@ bool Native::Execute(const CefString& name, char * const paths[] = {rootPath, NULL}; CefRefPtr 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())