Merge pull request #7140 from lioncash/move

DolphinQt2/RegisterWidget: std::move std::function instances in AddRegister()
This commit is contained in:
Léo Lam 2018-06-19 22:53:37 +02:00 committed by GitHub
commit a2bc62dd89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -4,6 +4,13 @@
#include "DolphinQt2/Debugger/RegisterWidget.h"
#include <utility>
#include <QHeaderView>
#include <QMenu>
#include <QTableWidget>
#include <QVBoxLayout>
#include "Core/Core.h"
#include "Core/HW/ProcessorInterface.h"
#include "Core/PowerPC/PowerPC.h"
@ -11,11 +18,6 @@
#include "DolphinQt2/QtUtils/ActionHelper.h"
#include "DolphinQt2/Settings.h"
#include <QHeaderView>
#include <QMenu>
#include <QTableWidget>
#include <QVBoxLayout>
RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
{
setWindowTitle(tr("Registers"));
@ -335,7 +337,7 @@ void RegisterWidget::PopulateTable()
void RegisterWidget::AddRegister(int row, int column, RegisterType type, std::string register_name,
std::function<u64()> get_reg, std::function<void(u64)> set_reg)
{
auto* value = new RegisterColumn(type, get_reg, set_reg);
auto* value = new RegisterColumn(type, std::move(get_reg), std::move(set_reg));
if (m_table->rowCount() <= row)
m_table->setRowCount(row + 1);