Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/inspector_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,11 @@ class HttpHandler : public ProtocolHandler {
static int OnMessageComplete(parser_t* parser) {
// Event needs to be fired after the parser is done.
HttpHandler* handler = From(parser);
handler->events_.push_back(
HttpEvent(handler->path_, parser->upgrade, parser->method == HTTP_GET,
handler->HeaderValue("Sec-WebSocket-Key"),
handler->HeaderValue("Host")));
handler->events_.emplace_back(handler->path_,
parser->upgrade,
parser->method == HTTP_GET,
handler->HeaderValue("Sec-WebSocket-Key"),
handler->HeaderValue("Host"));
handler->path_ = "";
handler->parsing_value_ = false;
handler->headers_.clear();
Expand Down
4 changes: 2 additions & 2 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ void AfterScanDirWithTypes(uv_fs_t* req) {
return req_wrap->Reject(error);

name_v.push_back(filename.ToLocalChecked());
type_v.push_back(Integer::New(isolate, ent.type));
type_v.emplace_back(Integer::New(isolate, ent.type));
}

Local<Array> result = Array::New(isolate, 2);
Expand Down Expand Up @@ -1505,7 +1505,7 @@ static void ReadDir(const FunctionCallbackInfo<Value>& args) {
name_v.push_back(filename.ToLocalChecked());

if (with_types) {
type_v.push_back(Integer::New(isolate, ent.type));
type_v.emplace_back(Integer::New(isolate, ent.type));
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/node_messaging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,8 @@ Maybe<bool> Message::Serialize(Environment* env,
env->isolate_data()->node_allocator()->UnregisterPointer(
contents.Data(), contents.ByteLength());

array_buffer_contents_.push_back(
MallocedBuffer<char> { static_cast<char*>(contents.Data()),
contents.ByteLength() });
array_buffer_contents_.emplace_back(MallocedBuffer<char>{
static_cast<char*>(contents.Data()), contents.ByteLength()});
}

delegate.Finish();
Expand Down
2 changes: 1 addition & 1 deletion src/node_native_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void NativeModuleLoader::ModuleIdsGetter(
ids.reserve(source_.size());

for (auto const& x : source_) {
ids.push_back(OneByteString(isolate, x.first.c_str(), x.first.size()));
ids.emplace_back(OneByteString(isolate, x.first.c_str(), x.first.size()));
}

info.GetReturnValue().Set(Array::New(isolate, ids.data(), ids.size()));
Expand Down
4 changes: 2 additions & 2 deletions src/node_process_methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static void GetActiveRequests(const FunctionCallbackInfo<Value>& args) {
AsyncWrap* w = req_wrap->GetAsyncWrap();
if (w->persistent().IsEmpty())
continue;
request_v.push_back(w->GetOwner());
request_v.emplace_back(w->GetOwner());
}

args.GetReturnValue().Set(
Expand All @@ -272,7 +272,7 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) {
for (auto w : *env->handle_wrap_queue()) {
if (!HandleWrap::HasRef(w))
continue;
handle_v.push_back(w->GetOwner());
handle_v.emplace_back(w->GetOwner());
}
args.GetReturnValue().Set(
Array::New(env->isolate(), handle_v.data(), handle_v.size()));
Expand Down
2 changes: 1 addition & 1 deletion src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ void URL::Parse(const char* input,
break;
default:
if (url->path.size() == 0)
url->path.push_back("");
url->path.emplace_back("");
if (url->path.size() > 0 && ch != kEOL)
AppendOrEscape(&url->path[0], ch, C0_CONTROL_ENCODE_SET);
}
Expand Down