Skip to content

Commit

Permalink
refactor: use base::flat_set for WebWorkerObserver::environments_
Browse files Browse the repository at this point in the history
  • Loading branch information
ckerr committed Dec 22, 2023
1 parent b23296b commit 24340d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shell/renderer/web_worker_observer.cc
Expand Up @@ -98,7 +98,7 @@ void WebWorkerObserver::ContextWillDestroy(v8::Local<v8::Context> context) {
DCHECK_EQ(microtask_queue->GetMicrotasksScopeDepth(), 0);
microtask_queue->set_microtasks_policy(v8::MicrotasksPolicy::kExplicit);

std::erase_if(environments_,
base::EraseIf(environments_,
[env](auto const& item) { return item.get() == env; });

microtask_queue->set_microtasks_policy(old_policy);
Expand Down
4 changes: 2 additions & 2 deletions shell/renderer/web_worker_observer.h
Expand Up @@ -6,8 +6,8 @@
#define ELECTRON_SHELL_RENDERER_WEB_WORKER_OBSERVER_H_

#include <memory>
#include <set>

#include "base/containers/flat_set.h"
#include "v8/include/v8.h"

namespace node {
Expand Down Expand Up @@ -42,7 +42,7 @@ class WebWorkerObserver {
private:
std::unique_ptr<NodeBindings> node_bindings_;
std::unique_ptr<ElectronBindings> electron_bindings_;
std::set<std::shared_ptr<node::Environment>> environments_;
base::flat_set<std::shared_ptr<node::Environment>> environments_;
};

} // namespace electron
Expand Down

0 comments on commit 24340d4

Please sign in to comment.