mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 01:59:33 +08:00
perf: m_plugins 使用 vector 而非 set
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <memory>
|
||||
#include <meojson/json.hpp>
|
||||
#include <set>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/AsstMsg.h"
|
||||
#include "InstHelper.h"
|
||||
@@ -44,7 +44,7 @@ namespace asst
|
||||
std::shared_ptr<PluginType> register_plugin()
|
||||
{
|
||||
auto plugin = std::make_shared<PluginType>(m_callback, m_inst, m_task_chain);
|
||||
m_plugins.emplace(plugin);
|
||||
m_plugins.emplace_back(plugin);
|
||||
return plugin;
|
||||
}
|
||||
void clear_plugin() noexcept;
|
||||
@@ -52,6 +52,7 @@ namespace asst
|
||||
bool get_enable() const noexcept { return m_enable; }
|
||||
bool get_ignore_error() const noexcept { return m_ignore_error; }
|
||||
std::string_view get_task_chain() const noexcept { return m_task_chain; }
|
||||
std::vector<TaskPluginPtr> get_plugins() const noexcept { return m_plugins; }
|
||||
int get_task_id() const noexcept { return m_task_id; }
|
||||
virtual json::value basic_info() const;
|
||||
|
||||
@@ -77,7 +78,7 @@ namespace asst
|
||||
|
||||
mutable json::value m_basic_info_cache;
|
||||
int m_task_id = 0;
|
||||
std::set<TaskPluginPtr> m_plugins;
|
||||
std::vector<TaskPluginPtr> m_plugins;
|
||||
std::map<std::filesystem::path, size_t> m_save_file_cnt;
|
||||
};
|
||||
} // namespace asst
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#pragma once
|
||||
#include <set>
|
||||
|
||||
#include "Common/AsstInfrastDef.h"
|
||||
#include "Common/AsstTypes.h"
|
||||
#include "Task/AbstractTask.h"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#pragma once
|
||||
#include <set>
|
||||
|
||||
#include "Common/AsstBattleDef.h"
|
||||
#include "Task/AbstractTask.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user