Replace more Move/Forward with STL variants.

This commit is contained in:
David Anderson
2020-05-19 12:56:28 -07:00
parent 7a3e4054c7
commit 301bafa3f5
11 changed files with 28 additions and 23 deletions
+5 -4
View File
@@ -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]();