| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,6 +37,8 @@ | |||
| 37 | 37 | #include <stddef.h> | |
| 38 | 38 | #include <stdint.h> | |
| 39 | 39 | ||
| 40 | + #include <utility> | ||
| 41 | + | ||
| 40 | 42 | namespace node { | |
| 41 | 43 | ||
| 42 | 44 | inline v8::Isolate* IsolateData::isolate() const { | |
@@ -395,7 +397,7 @@ inline uv_loop_t* Environment::event_loop() const { | |||
| 395 | 397 | inline void Environment::TryLoadAddon( | |
| 396 | 398 | const char* filename, | |
| 397 | 399 | int flags, | |
| 398 | - std::function<bool(binding::DLib*)> was_loaded) { | ||
| 400 | + const std::function<bool(binding::DLib*)>& was_loaded) { | ||
| 399 | 401 | loaded_addons_.emplace_back(filename, flags); | |
| 400 | 402 | if (!was_loaded(&loaded_addons_.back())) { | |
| 401 | 403 | loaded_addons_.pop_back(); | |
@@ -597,7 +599,7 @@ inline std::shared_ptr<PerIsolateOptions> IsolateData::options() { | |||
| 597 | 599 | ||
| 598 | 600 | inline void IsolateData::set_options( | |
| 599 | 601 | std::shared_ptr<PerIsolateOptions> options) { | |
| 600 | - options_ = options; | ||
| 602 | + options_ = std::move(options); | ||
| 601 | 603 | } | |
| 602 | 604 | ||
| 603 | 605 | void Environment::CreateImmediate(native_immediate_callback cb, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -661,9 +661,10 @@ class Environment { | |||
| 661 | 661 | ||
| 662 | 662 | inline v8::Isolate* isolate() const; | |
| 663 | 663 | inline uv_loop_t* event_loop() const; | |
| 664 | - inline void TryLoadAddon(const char* filename, | ||
| 665 | - int flags, | ||
| 666 | - std::function<bool(binding::DLib*)> was_loaded); | ||
| 664 | + inline void TryLoadAddon( | ||
| 665 | + const char* filename, | ||
| 666 | + int flags, | ||
| 667 | + const std::function<bool(binding::DLib*)>& was_loaded); | ||
| 667 | 668 | ||
| 668 | 669 | static inline Environment* from_timer_handle(uv_timer_t* handle); | |
| 669 | 670 | inline uv_timer_t* timer_handle(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2685,7 +2685,7 @@ static ParsePublicKeyResult TryParsePublicKey( | |||
| 2685 | 2685 | const BIOPointer& bp, | |
| 2686 | 2686 | const char* name, | |
| 2687 | 2687 | // NOLINTNEXTLINE(runtime/int) | |
| 2688 | - std::function<EVP_PKEY*(const unsigned char** p, long l)> parse) { | ||
| 2688 | + const std::function<EVP_PKEY*(const unsigned char** p, long l)>& parse) { | ||
| 2689 | 2689 | unsigned char* der_data; | |
| 2690 | 2690 | long der_len; // NOLINT(runtime/int) | |
| 2691 | 2691 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -148,7 +148,7 @@ MaybeLocal<Value> Message::Deserialize(Environment* env, | |||
| 148 | 148 | } | |
| 149 | 149 | ||
| 150 | 150 | void Message::AddSharedArrayBuffer( | |
| 151 | - SharedArrayBufferMetadataReference reference) { | ||
| 151 | + const SharedArrayBufferMetadataReference& reference) { | ||
| 152 | 152 | shared_array_buffers_.push_back(reference); | |
| 153 | 153 | } | |
| 154 | 154 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ class Message : public MemoryRetainer { | |||
| 43 | 43 | ||
| 44 | 44 | // Internal method of Message that is called when a new SharedArrayBuffer | |
| 45 | 45 | // object is encountered in the incoming value's structure. | |
| 46 | - void AddSharedArrayBuffer(SharedArrayBufferMetadataReference ref); | ||
| 46 | + void AddSharedArrayBuffer(const SharedArrayBufferMetadataReference& ref); | ||
| 47 | 47 | // Internal method of Message that is called once serialization finishes | |
| 48 | 48 | // and that transfers ownership of `data` to this message. | |
| 49 | 49 | void AddMessagePort(std::unique_ptr<MessagePortData>&& data); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -181,7 +181,7 @@ void ClearMark(const FunctionCallbackInfo<Value>& args) { | |||
| 181 | 181 | } | |
| 182 | 182 | } | |
| 183 | 183 | ||
| 184 | - inline uint64_t GetPerformanceMark(Environment* env, std::string name) { | ||
| 184 | + inline uint64_t GetPerformanceMark(Environment* env, const std::string& name) { | ||
| 185 | 185 | auto marks = env->performance_marks(); | |
| 186 | 186 | auto res = marks->find(name); | |
| 187 | 187 | return res != marks->end() ? res->second : 0; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -109,16 +109,16 @@ class URL { | |||
| 109 | 109 | } | |
| 110 | 110 | } | |
| 111 | 111 | ||
| 112 | - explicit URL(std::string input) : | ||
| 112 | + explicit URL(const std::string& input) : | ||
| 113 | 113 | URL(input.c_str(), input.length()) {} | |
| 114 | 114 | ||
| 115 | - URL(std::string input, const URL* base) : | ||
| 115 | + URL(const std::string& input, const URL* base) : | ||
| 116 | 116 | URL(input.c_str(), input.length(), base) {} | |
| 117 | 117 | ||
| 118 | - URL(std::string input, const URL& base) : | ||
| 118 | + URL(const std::string& input, const URL& base) : | ||
| 119 | 119 | URL(input.c_str(), input.length(), &base) {} | |
| 120 | 120 | ||
| 121 | - URL(std::string input, std::string base) : | ||
| 121 | + URL(const std::string& input, const std::string& base) : | ||
| 122 | 122 | URL(input.c_str(), input.length(), base.c_str(), base.length()) {} | |
| 123 | 123 | ||
| 124 | 124 | int32_t flags() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,6 @@ | |||
| 1 | 1 | #include "sharedarraybuffer_metadata.h" | |
| 2 | + | ||
| 3 | + #include <utility> | ||
| 2 | 4 | #include "base_object.h" | |
| 3 | 5 | #include "base_object-inl.h" | |
| 4 | 6 | #include "node_errors.h" | |
@@ -43,7 +45,7 @@ class SABLifetimePartner : public BaseObject { | |||
| 43 | 45 | Local<Object> obj, | |
| 44 | 46 | SharedArrayBufferMetadataReference r) | |
| 45 | 47 | : BaseObject(env, obj), | |
| 46 | - reference(r) { | ||
| 48 | + reference(std::move(r)) { | ||
| 47 | 49 | MakeWeak(); | |
| 48 | 50 | } | |
| 49 | 51 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,6 +40,7 @@ | |||
| 40 | 40 | #include <string> | |
| 41 | 41 | #include <array> | |
| 42 | 42 | #include <unordered_map> | |
| 43 | + #include <utility> | ||
| 43 | 44 | ||
| 44 | 45 | namespace node { | |
| 45 | 46 | ||
@@ -450,7 +451,7 @@ template <typename T> inline void USE(T&&) {} | |||
| 450 | 451 | struct OnScopeLeave { | |
| 451 | 452 | std::function<void()> fn_; | |
| 452 | 453 | ||
| 453 | - explicit OnScopeLeave(std::function<void()> fn) : fn_(fn) {} | ||
| 454 | + explicit OnScopeLeave(std::function<void()> fn) : fn_(std::move(fn)) {} | ||
| 454 | 455 | ~OnScopeLeave() { fn_(); } | |
| 455 | 456 | }; | |
| 456 | 457 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,7 +92,7 @@ class SocketWrapper { | |||
| 92 | 92 | connected_(false), | |
| 93 | 93 | sending_(false) { } | |
| 94 | 94 | ||
| 95 | - void Connect(std::string host, int port, bool v6 = false) { | ||
| 95 | + void Connect(const std::string& host, int port, bool v6 = false) { | ||
| 96 | 96 | closed_ = false; | |
| 97 | 97 | connection_failed_ = false; | |
| 98 | 98 | connected_ = false; | |
@@ -114,7 +114,7 @@ class SocketWrapper { | |||
| 114 | 114 | ReadCallback); | |
| 115 | 115 | } | |
| 116 | 116 | ||
| 117 | - void ExpectFailureToConnect(std::string host, int port) { | ||
| 117 | + void ExpectFailureToConnect(const std::string& host, int port) { | ||
| 118 | 118 | connected_ = false; | |
| 119 | 119 | connection_failed_ = false; | |
| 120 | 120 | closed_ = false; | |
@@ -243,7 +243,7 @@ class ServerHolder { | |||
| 243 | 243 | : ServerHolder(has_targets, loop, HOST, port, nullptr) { } | |
| 244 | 244 | ||
| 245 | 245 | ServerHolder(bool has_targets, uv_loop_t* loop, | |
| 246 | - const std::string host, int port, FILE* out); | ||
| 246 | + const std::string& host, int port, FILE* out); | ||
| 247 | 247 | ||
| 248 | 248 | InspectorSocketServer* operator->() { | |
| 249 | 249 | return server_.get(); | |
@@ -350,7 +350,7 @@ class TestSocketServerDelegate : public SocketServerDelegate { | |||
| 350 | 350 | }; | |
| 351 | 351 | ||
| 352 | 352 | ServerHolder::ServerHolder(bool has_targets, uv_loop_t* loop, | |
| 353 | - const std::string host, int port, FILE* out) { | ||
| 353 | + const std::string& host, int port, FILE* out) { | ||
| 354 | 354 | std::vector<std::string> targets; | |
| 355 | 355 | if (has_targets) | |
| 356 | 356 | targets = { MAIN_TARGET_ID }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments