Using std::move, remove unused vars, better use '= default;'

This commit is contained in:
germanaizek
2022-04-26 18:19:03 +03:00
parent 5295a925d8
commit 0ca29f1e54
12 changed files with 11 additions and 12 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ void Fiber::YieldTo(std::weak_ptr<Fiber> weak_from, Fiber& to) {
}
std::shared_ptr<Fiber> Fiber::ThreadToFiber() {
std::shared_ptr<Fiber> fiber = std::shared_ptr<Fiber>{new Fiber()};
auto fiber = std::make_shared<Fiber>();
fiber->impl->guard.lock();
fiber->impl->is_thread_fiber = true;
return fiber;
+1 -1
View File
@@ -120,7 +120,7 @@ private:
// and a pointer to the next ElementPtr
class ElementPtr {
public:
ElementPtr() {}
ElementPtr() = default;
~ElementPtr() {
ElementPtr* next_ptr = next.load();
+1 -1
View File
@@ -67,7 +67,7 @@ private:
public:
KAutoObjectWithSlabHeapAndContainer(KernelCore& kernel_) : Base(kernel_), kernel(kernel_) {}
virtual ~KAutoObjectWithSlabHeapAndContainer() {}
virtual ~KAutoObjectWithSlabHeapAndContainer() = default;
virtual void Destroy() override {
const bool is_initialized = this->IsInitialized();
+1 -1
View File
@@ -409,7 +409,7 @@ void DynarmicCallbacks64::InterpreterFallback(u64 pc, size_t num_instructions) {
JITContext::JITContext(Core::Memory::Memory& memory)
: impl{std::make_unique<JITContextImpl>(memory)} {}
JITContext::~JITContext() {}
JITContext::~JITContext() = default;
bool JITContext::LoadNRO(std::span<const u8> data) {
return impl->LoadNRO(data);
@@ -11,7 +11,7 @@ namespace Service::NVFlinger {
HosBinderDriverServer::HosBinderDriverServer(Core::System& system_)
: service_context(system_, "HosBinderDriverServer") {}
HosBinderDriverServer::~HosBinderDriverServer() {}
HosBinderDriverServer::~HosBinderDriverServer() = default;
u64 HosBinderDriverServer::RegisterProducer(std::unique_ptr<android::IBinder>&& binder) {
std::scoped_lock lk{lock};
@@ -135,7 +135,7 @@ private:
class RescalingPushConstant {
public:
explicit RescalingPushConstant() noexcept {}
explicit RescalingPushConstant() noexcept = default;
void PushTexture(bool is_rescaled) noexcept {
*texture_ptr |= is_rescaled ? texture_bit : 0u;
+1 -1
View File
@@ -105,7 +105,7 @@ struct Client::Impl {
httplib::Request request;
request.method = method;
request.path = path;
request.headers = params;
request.headers = std::move(params);
request.body = data;
httplib::Response response;
@@ -234,7 +234,6 @@ QString ConfigureInputPlayer::AnalogToText(const Common::ParamPackage& param,
return QObject::tr("[unknown]");
}
const auto engine_str = param.Get("engine", "");
const QString axis_x_str = QString::fromStdString(param.Get("axis_x", ""));
const QString axis_y_str = QString::fromStdString(param.Get("axis_y", ""));
const bool invert_x = param.Get("invert_x", "+") == "-";
@@ -86,7 +86,7 @@ void ConfigurePerGameAddons::ApplyConfiguration() {
"game_list" / fmt::format("{:016X}.pv.txt", title_id));
}
Settings::values.disabled_addons[title_id] = disabled_addons;
Settings::values.disabled_addons[title_id] = std::move(disabled_addons);
}
void ConfigurePerGameAddons::LoadFromFile(FileSys::VirtualFile file) {
@@ -392,7 +392,6 @@ QString ConfigureRingController::AnalogToText(const Common::ParamPackage& param,
return QObject::tr("[unknown]");
}
const auto engine_str = param.Get("engine", "");
const QString axis_x_str = QString::fromStdString(param.Get("axis_x", ""));
const QString axis_y_str = QString::fromStdString(param.Get("axis_y", ""));
const bool invert_x = param.Get("invert_x", "+") == "-";
+1
View File
@@ -131,6 +131,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeMutexInfo::GetChildren() cons
const bool has_waiters = (mutex_value & Kernel::Svc::HandleWaitMask) != 0;
std::vector<std::unique_ptr<WaitTreeItem>> list;
list.reserve(3);
list.push_back(std::make_unique<WaitTreeText>(tr("has waiters: %1").arg(has_waiters)));
list.push_back(std::make_unique<WaitTreeText>(
tr("owner handle: 0x%1").arg(owner_handle, 8, 16, QLatin1Char{'0'})));
+2 -2
View File
@@ -159,7 +159,7 @@ void Config::ReadValues() {
"ControlsGeneral", std::string("debug_pad_") + Settings::NativeButton::mapping[i],
default_param);
if (Settings::values.debug_pad_buttons[i].empty())
Settings::values.debug_pad_buttons[i] = default_param;
Settings::values.debug_pad_buttons[i] = std::move(default_param);
}
for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) {
@@ -170,7 +170,7 @@ void Config::ReadValues() {
"ControlsGeneral", std::string("debug_pad_") + Settings::NativeAnalog::mapping[i],
default_param);
if (Settings::values.debug_pad_analogs[i].empty())
Settings::values.debug_pad_analogs[i] = default_param;
Settings::values.debug_pad_analogs[i] = std::move(default_param);
}
ReadSetting("ControlsGeneral", Settings::values.vibration_enabled);