Replace more Move/Forward with STL variants.
This commit is contained in:
+1
-1
@@ -291,7 +291,7 @@ ConfigResult CoreConfig::SetConfigOption(const char *option, const char *value,
|
||||
}
|
||||
|
||||
ke::AString vstr(value);
|
||||
m_KeyValues.replace(option, ke::Move(vstr));
|
||||
m_KeyValues.replace(option, std::move(vstr));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -640,7 +640,7 @@ bool CBaseMenu::AppendItem(const char *info, const ItemDrawInfo &draw)
|
||||
item.display = std::make_unique<ke::AString>(draw.display);
|
||||
item.style = draw.style;
|
||||
|
||||
m_items.append(ke::Move(item));
|
||||
m_items.append(std::move(item));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -661,7 +661,7 @@ bool CBaseMenu::InsertItem(unsigned int position, const char *info, const ItemDr
|
||||
item.display = std::make_unique<ke::AString>(draw.display);
|
||||
item.style = draw.style;
|
||||
|
||||
m_items.insert(position, ke::Move(item));
|
||||
m_items.insert(position, std::move(item));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#define _INCLUDE_MENUSTYLE_BASE_H
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include <IMenuManager.h>
|
||||
#include <IPlayerHelpers.h>
|
||||
@@ -51,16 +52,16 @@ public:
|
||||
access = 0;
|
||||
}
|
||||
CItem(CItem &&other)
|
||||
: info(ke::Move(other.info)),
|
||||
display(ke::Move(other.display))
|
||||
: info(std::move(other.info)),
|
||||
display(std::move(other.display))
|
||||
{
|
||||
style = other.style;
|
||||
access = other.access;
|
||||
}
|
||||
CItem & operator =(CItem &&other)
|
||||
{
|
||||
info = ke::Move(other.info);
|
||||
display = ke::Move(other.display);
|
||||
info = std::move(other.info);
|
||||
display = std::move(other.display);
|
||||
style = other.style;
|
||||
access = other.access;
|
||||
return *this;
|
||||
|
||||
@@ -400,13 +400,13 @@ SMCResult CGameConfig::ReadSMC_KeyValue(const SMCStates *states, const char *key
|
||||
}
|
||||
} else if (m_ParseState == PSTATE_GAMEDEFS_KEYS) {
|
||||
ke::AString vstr(value);
|
||||
m_Keys.replace(key, ke::Move(vstr));
|
||||
m_Keys.replace(key, std::move(vstr));
|
||||
}
|
||||
else if (m_ParseState == PSTATE_GAMEDEFS_KEYS_PLATFORM) {
|
||||
if (IsPlatformCompatible(key, &matched_platform))
|
||||
{
|
||||
ke::AString vstr(value);
|
||||
m_Keys.replace(m_Key, ke::Move(vstr));
|
||||
m_Keys.replace(m_Key, std::move(vstr));
|
||||
}
|
||||
} else if (m_ParseState == PSTATE_GAMEDEFS_SUPPORTED) {
|
||||
if (strcmp(key, "game") == 0)
|
||||
|
||||
@@ -1211,7 +1211,7 @@ void CPluginManager::LoadExtensions(CPlugin *pPlugin)
|
||||
}
|
||||
return true;
|
||||
};
|
||||
pPlugin->ForEachExtVar(ke::Move(callback));
|
||||
pPlugin->ForEachExtVar(std::move(callback));
|
||||
}
|
||||
|
||||
bool CPluginManager::RequireExtensions(CPlugin *pPlugin)
|
||||
@@ -1247,7 +1247,7 @@ bool CPluginManager::RequireExtensions(CPlugin *pPlugin)
|
||||
return true;
|
||||
};
|
||||
|
||||
return pPlugin->ForEachExtVar(ke::Move(callback));
|
||||
return pPlugin->ForEachExtVar(std::move(callback));
|
||||
}
|
||||
|
||||
CPlugin *CPluginManager::CompileAndPrep(const char *path)
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
// or <http://www.sourcemod.net/license.php>.
|
||||
#include "frame_tasks.h"
|
||||
#include <am-vector.h>
|
||||
#include <utility>
|
||||
|
||||
using namespace SourceMod;
|
||||
|
||||
@@ -35,7 +36,7 @@ ke::Vector<ke::Function<void()>> sWorkTasks;
|
||||
void
|
||||
SourceMod::ScheduleTaskForNextFrame(ke::Function<void()>&& task)
|
||||
{
|
||||
sNextTasks.append(ke::Forward<decltype(task)>(task));
|
||||
sNextTasks.append(std::forward<decltype(task)>(task));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -45,9 +46,9 @@ SourceMod::RunScheduledFrameTasks(bool simulating)
|
||||
return;
|
||||
|
||||
// Swap.
|
||||
ke::Vector<ke::Function<void()>> temp(ke::Move(sNextTasks));
|
||||
sNextTasks = ke::Move(sWorkTasks);
|
||||
sWorkTasks = ke::Move(temp);
|
||||
ke::Vector<ke::Function<void()>> temp(std::move(sNextTasks));
|
||||
sNextTasks = std::move(sWorkTasks);
|
||||
sWorkTasks = std::move(temp);
|
||||
|
||||
for (size_t i = 0; i < sWorkTasks.length(); i++)
|
||||
sWorkTasks[i]();
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <memory>
|
||||
|
||||
#include "common_logic.h"
|
||||
#include <am-moveable.h>
|
||||
#include <am-refcounting.h>
|
||||
#include <sm_stringhashmap.h>
|
||||
#include "sm_memtable.h"
|
||||
|
||||
@@ -1540,7 +1540,7 @@ static cell_t SQL_AddQuery(IPluginContext *pContext, const cell_t *params)
|
||||
Transaction::Entry entry;
|
||||
entry.query = query;
|
||||
entry.data = params[3];
|
||||
txn->entries.append(ke::Move(entry));
|
||||
txn->entries.append(std::move(entry));
|
||||
|
||||
return cell_t(txn->entries.length() - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user