mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 22:57:22 +00:00
Using reserve() for optimization inserts, marked unused pair items and minor code refactor
This commit is contained in:
parent
9490b5264e
commit
e886f27816
27 changed files with 43 additions and 32 deletions
|
@ -54,7 +54,8 @@ public:
|
||||||
const s32 to_register{std::min(std::min(appended_count, BufferAppendLimit),
|
const s32 to_register{std::min(std::min(appended_count, BufferAppendLimit),
|
||||||
BufferAppendLimit - registered_count)};
|
BufferAppendLimit - registered_count)};
|
||||||
|
|
||||||
for (s32 i = 0; i < to_register; i++) {
|
out_buffers.reserve(to_register);
|
||||||
|
for (s32 i = 0; i < to_register; ++i) {
|
||||||
s32 index{appended_index - appended_count};
|
s32 index{appended_index - appended_count};
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
index += N;
|
index += N;
|
||||||
|
@ -180,6 +181,7 @@ public:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buffers_flushed.reserve(registered_count + appended_count);
|
||||||
while (registered_count > 0) {
|
while (registered_count > 0) {
|
||||||
auto index{registered_index - registered_count};
|
auto index{registered_index - registered_count};
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
|
|
|
@ -80,6 +80,7 @@ FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs,
|
||||||
if (filename == "00") {
|
if (filename == "00") {
|
||||||
const auto dir = vfs->OpenDirectory(dir_name, FileSys::OpenMode::Read);
|
const auto dir = vfs->OpenDirectory(dir_name, FileSys::OpenMode::Read);
|
||||||
std::vector<FileSys::VirtualFile> concat;
|
std::vector<FileSys::VirtualFile> concat;
|
||||||
|
concat.reserve(0x10);
|
||||||
|
|
||||||
for (u32 i = 0; i < 0x10; ++i) {
|
for (u32 i = 0; i < 0x10; ++i) {
|
||||||
const auto file_name = fmt::format("{:02X}", i);
|
const auto file_name = fmt::format("{:02X}", i);
|
||||||
|
|
|
@ -481,6 +481,7 @@ void GDBStub::HandleQuery(std::string_view command) {
|
||||||
// beginning of list
|
// beginning of list
|
||||||
const auto& threads = GetProcess()->GetThreadList();
|
const auto& threads = GetProcess()->GetThreadList();
|
||||||
std::vector<std::string> thread_ids;
|
std::vector<std::string> thread_ids;
|
||||||
|
thread_ids.reserve(threads.size());
|
||||||
for (const auto& thread : threads) {
|
for (const auto& thread : threads) {
|
||||||
thread_ids.push_back(fmt::format("{:x}", thread.GetThreadId()));
|
thread_ids.push_back(fmt::format("{:x}", thread.GetThreadId()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,7 +261,7 @@ std::vector<NcaID> PlaceholderCache::List() const {
|
||||||
std::vector<NcaID> out;
|
std::vector<NcaID> out;
|
||||||
for (const auto& sdir : dir->GetSubdirectories()) {
|
for (const auto& sdir : dir->GetSubdirectories()) {
|
||||||
for (const auto& file : sdir->GetFiles()) {
|
for (const auto& file : sdir->GetFiles()) {
|
||||||
const auto name = file->GetName();
|
const auto& name = file->GetName();
|
||||||
if (name.length() == 36 && name.ends_with(".nca")) {
|
if (name.length() == 36 && name.ends_with(".nca")) {
|
||||||
out.push_back(Common::HexStringToArray<0x10>(name.substr(0, 32)));
|
out.push_back(Common::HexStringToArray<0x10>(name.substr(0, 32)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,9 @@ std::vector<std::shared_ptr<NCA>> NSP::GetNCAsCollapsed() const {
|
||||||
if (extracted)
|
if (extracted)
|
||||||
LOG_WARNING(Service_FS, "called on an NSP that is of type extracted.");
|
LOG_WARNING(Service_FS, "called on an NSP that is of type extracted.");
|
||||||
std::vector<std::shared_ptr<NCA>> out;
|
std::vector<std::shared_ptr<NCA>> out;
|
||||||
|
out.reserve(ncas.size());
|
||||||
for (const auto& map : ncas) {
|
for (const auto& map : ncas) {
|
||||||
|
out.reserve(map.second.size());
|
||||||
for (const auto& inner_map : map.second)
|
for (const auto& inner_map : map.second)
|
||||||
out.push_back(inner_map.second);
|
out.push_back(inner_map.second);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ constexpr std::array<u8, 30> WORD_TXT{
|
||||||
|
|
||||||
VirtualDir NgWord1() {
|
VirtualDir NgWord1() {
|
||||||
std::vector<VirtualFile> files;
|
std::vector<VirtualFile> files;
|
||||||
files.reserve(NgWord1Data::NUMBER_WORD_TXT_FILES);
|
files.reserve(files.size() + 2);
|
||||||
|
|
||||||
for (std::size_t i = 0; i < files.size(); ++i) {
|
for (std::size_t i = 0; i < files.size(); ++i) {
|
||||||
files.push_back(MakeArrayFile(NgWord1Data::WORD_TXT, fmt::format("{}.txt", i)));
|
files.push_back(MakeArrayFile(NgWord1Data::WORD_TXT, fmt::format("{}.txt", i)));
|
||||||
|
@ -54,7 +54,7 @@ constexpr std::array<u8, 0x2C> AC_NX_DATA{
|
||||||
|
|
||||||
VirtualDir NgWord2() {
|
VirtualDir NgWord2() {
|
||||||
std::vector<VirtualFile> files;
|
std::vector<VirtualFile> files;
|
||||||
files.reserve(NgWord2Data::NUMBER_AC_NX_FILES * 3);
|
files.reserve(NgWord2Data::NUMBER_AC_NX_FILES + 4);
|
||||||
|
|
||||||
for (std::size_t i = 0; i < NgWord2Data::NUMBER_AC_NX_FILES; ++i) {
|
for (std::size_t i = 0; i < NgWord2Data::NUMBER_AC_NX_FILES; ++i) {
|
||||||
files.push_back(MakeArrayFile(NgWord2Data::AC_NX_DATA, fmt::format("ac_{}_b1_nx", i)));
|
files.push_back(MakeArrayFile(NgWord2Data::AC_NX_DATA, fmt::format("ac_{}_b1_nx", i)));
|
||||||
|
|
|
@ -37,6 +37,7 @@ const static std::map<std::string, const std::map<const char*, const std::vector
|
||||||
|
|
||||||
static void GenerateFiles(std::vector<VirtualFile>& directory,
|
static void GenerateFiles(std::vector<VirtualFile>& directory,
|
||||||
const std::map<const char*, const std::vector<u8>>& files) {
|
const std::map<const char*, const std::vector<u8>>& files) {
|
||||||
|
directory.reserve(files.size());
|
||||||
for (const auto& [filename, data] : files) {
|
for (const auto& [filename, data] : files) {
|
||||||
const auto data_copy{data};
|
const auto data_copy{data};
|
||||||
const std::string filename_copy{filename};
|
const std::string filename_copy{filename};
|
||||||
|
@ -54,6 +55,7 @@ static std::vector<VirtualFile> GenerateZoneinfoFiles() {
|
||||||
|
|
||||||
VirtualDir TimeZoneBinary() {
|
VirtualDir TimeZoneBinary() {
|
||||||
std::vector<VirtualDir> america_sub_dirs;
|
std::vector<VirtualDir> america_sub_dirs;
|
||||||
|
america_sub_dirs.reserve(tzdb_america_dirs.size());
|
||||||
for (const auto& [dir_name, files] : tzdb_america_dirs) {
|
for (const auto& [dir_name, files] : tzdb_america_dirs) {
|
||||||
std::vector<VirtualFile> vfs_files;
|
std::vector<VirtualFile> vfs_files;
|
||||||
GenerateFiles(vfs_files, files);
|
GenerateFiles(vfs_files, files);
|
||||||
|
@ -62,6 +64,7 @@ VirtualDir TimeZoneBinary() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<VirtualDir> zoneinfo_sub_dirs;
|
std::vector<VirtualDir> zoneinfo_sub_dirs;
|
||||||
|
zoneinfo_sub_dirs.reserve(tzdb_zoneinfo_dirs.size());
|
||||||
for (const auto& [dir_name, files] : tzdb_zoneinfo_dirs) {
|
for (const auto& [dir_name, files] : tzdb_zoneinfo_dirs) {
|
||||||
std::vector<VirtualFile> vfs_files;
|
std::vector<VirtualFile> vfs_files;
|
||||||
GenerateFiles(vfs_files, files);
|
GenerateFiles(vfs_files, files);
|
||||||
|
|
|
@ -38,7 +38,8 @@ VirtualDir CachedVfsDirectory::GetSubdirectory(std::string_view dir_name) const
|
||||||
|
|
||||||
std::vector<VirtualFile> CachedVfsDirectory::GetFiles() const {
|
std::vector<VirtualFile> CachedVfsDirectory::GetFiles() const {
|
||||||
std::vector<VirtualFile> out;
|
std::vector<VirtualFile> out;
|
||||||
for (auto& [file_name, file] : files) {
|
out.reserve(files.size());
|
||||||
|
for (const auto& [_, file] : files) {
|
||||||
out.push_back(file);
|
out.push_back(file);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
|
@ -46,7 +47,8 @@ std::vector<VirtualFile> CachedVfsDirectory::GetFiles() const {
|
||||||
|
|
||||||
std::vector<VirtualDir> CachedVfsDirectory::GetSubdirectories() const {
|
std::vector<VirtualDir> CachedVfsDirectory::GetSubdirectories() const {
|
||||||
std::vector<VirtualDir> out;
|
std::vector<VirtualDir> out;
|
||||||
for (auto& [dir_name, dir] : dirs) {
|
out.reserve(dirs.size());
|
||||||
|
for (auto& [_, dir] : dirs) {
|
||||||
out.push_back(dir);
|
out.push_back(dir);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
|
|
|
@ -121,7 +121,7 @@ void WindowSystem::RequestAppletVisibilityState(Applet& applet, bool visible) {
|
||||||
void WindowSystem::OnOperationModeChanged() {
|
void WindowSystem::OnOperationModeChanged() {
|
||||||
std::scoped_lock lk{m_lock};
|
std::scoped_lock lk{m_lock};
|
||||||
|
|
||||||
for (const auto& [aruid, applet] : m_applets) {
|
for (const auto& [_, applet] : m_applets) {
|
||||||
std::scoped_lock lk2{applet->lock};
|
std::scoped_lock lk2{applet->lock};
|
||||||
applet->lifecycle_manager.OnOperationAndPerformanceModeChanged();
|
applet->lifecycle_manager.OnOperationAndPerformanceModeChanged();
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ void WindowSystem::OnOperationModeChanged() {
|
||||||
void WindowSystem::OnExitRequested() {
|
void WindowSystem::OnExitRequested() {
|
||||||
std::scoped_lock lk{m_lock};
|
std::scoped_lock lk{m_lock};
|
||||||
|
|
||||||
for (const auto& [aruid, applet] : m_applets) {
|
for (const auto& [_, applet] : m_applets) {
|
||||||
std::scoped_lock lk2{applet->lock};
|
std::scoped_lock lk2{applet->lock};
|
||||||
applet->lifecycle_manager.RequestExit();
|
applet->lifecycle_manager.RequestExit();
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ void WindowSystem::OnHomeButtonPressed(ButtonPressDuration type) {
|
||||||
|
|
||||||
void WindowSystem::PruneTerminatedAppletsLocked() {
|
void WindowSystem::PruneTerminatedAppletsLocked() {
|
||||||
for (auto it = m_applets.begin(); it != m_applets.end(); /* ... */) {
|
for (auto it = m_applets.begin(); it != m_applets.end(); /* ... */) {
|
||||||
const auto& [aruid, applet] = *it;
|
const auto& [_, applet] = *it;
|
||||||
|
|
||||||
std::scoped_lock lk{applet->lock};
|
std::scoped_lock lk{applet->lock};
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ Result LANDiscovery::Scan(std::span<NetworkInfo> out_networks, s16& out_count,
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
|
|
||||||
std::scoped_lock lock{packet_mutex};
|
std::scoped_lock lock{packet_mutex};
|
||||||
for (const auto& [key, info] : scan_results) {
|
for (const auto& [_, info] : scan_results) {
|
||||||
if (out_count >= static_cast<s16>(out_networks.size())) {
|
if (out_count >= static_cast<s16>(out_networks.size())) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,7 +348,7 @@ Result IApplicationManagerInterface::ListApplicationRecord(
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
u8 ii = 24;
|
u8 ii = 24;
|
||||||
|
|
||||||
for (const auto& [slot, game] : installed_games) {
|
for (const auto& [_, game] : installed_games) {
|
||||||
if (i >= limit) {
|
if (i >= limit) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ ServiceManager::ServiceManager(Kernel::KernelCore& kernel_) : kernel{kernel_} {
|
||||||
}
|
}
|
||||||
|
|
||||||
ServiceManager::~ServiceManager() {
|
ServiceManager::~ServiceManager() {
|
||||||
for (auto& [name, port] : service_ports) {
|
for (auto& [_, port] : service_ports) {
|
||||||
port->Close();
|
port->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -571,7 +571,7 @@ SDLDriver::~SDLDriver() {
|
||||||
std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
|
std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
|
||||||
std::vector<Common::ParamPackage> devices;
|
std::vector<Common::ParamPackage> devices;
|
||||||
std::unordered_map<int, std::shared_ptr<SDLJoystick>> joycon_pairs;
|
std::unordered_map<int, std::shared_ptr<SDLJoystick>> joycon_pairs;
|
||||||
for (const auto& [key, value] : joystick_map) {
|
for (const auto& [_, value] : joystick_map) {
|
||||||
for (const auto& joystick : value) {
|
for (const auto& joystick : value) {
|
||||||
if (!joystick->GetSDLJoystick()) {
|
if (!joystick->GetSDLJoystick()) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -591,7 +591,7 @@ std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add dual controllers
|
// Add dual controllers
|
||||||
for (const auto& [key, value] : joystick_map) {
|
for (const auto& [_, value] : joystick_map) {
|
||||||
for (const auto& joystick : value) {
|
for (const auto& joystick : value) {
|
||||||
if (joystick->IsJoyconRight()) {
|
if (joystick->IsJoyconRight()) {
|
||||||
if (!joycon_pairs.contains(joystick->GetPort())) {
|
if (!joycon_pairs.contains(joystick->GetPort())) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ void ConfigureApplets::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
|
|
||||||
applets_hold.emplace(setting->Id(), widget);
|
applets_hold.emplace(setting->Id(), widget);
|
||||||
}
|
}
|
||||||
for (const auto& [label, widget] : applets_hold) {
|
for (const auto& [_, widget] : applets_hold) {
|
||||||
library_applets_layout.addWidget(widget);
|
library_applets_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ void ConfigureAudio::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [id, widget] : hold) {
|
for (const auto& [_, widget] : hold) {
|
||||||
layout.addWidget(widget);
|
layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [label, widget] : unsafe_hold) {
|
for (const auto& [_, widget] : unsafe_hold) {
|
||||||
unsafe_layout->addWidget(widget);
|
unsafe_layout->addWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,10 +81,10 @@ void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [id, widget] : general_hold) {
|
for (const auto& [_, widget] : general_hold) {
|
||||||
general_layout.addWidget(widget);
|
general_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
for (const auto& [id, widget] : linux_hold) {
|
for (const auto& [_, widget] : linux_hold) {
|
||||||
linux_layout.addWidget(widget);
|
linux_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,7 +358,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [id, widget] : hold_graphics) {
|
for (const auto& [_, widget] : hold_graphics) {
|
||||||
graphics_layout.addWidget(widget);
|
graphics_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ void ConfigureGraphicsAdvanced::Setup(const ConfigurationShared::Builder& builde
|
||||||
checkbox_enable_compute_pipelines = widget;
|
checkbox_enable_compute_pipelines = widget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const auto& [id, widget] : hold) {
|
for (const auto& [_, widget] : hold) {
|
||||||
layout.addWidget(widget);
|
layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ void ConfigureLinuxTab::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
linux_hold.insert({setting->Id(), widget});
|
linux_hold.insert({setting->Id(), widget});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& [id, widget] : linux_hold) {
|
for (const auto& [_, widget] : linux_hold) {
|
||||||
linux_layout.addWidget(widget);
|
linux_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,10 +174,10 @@ void ConfigureSystem::Setup(const ConfigurationShared::Builder& builder) {
|
||||||
widget->deleteLater();
|
widget->deleteLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const auto& [label, widget] : core_hold) {
|
for (const auto& [_, widget] : core_hold) {
|
||||||
core_layout.addWidget(widget);
|
core_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
for (const auto& [id, widget] : system_hold) {
|
for (const auto& [_, widget] : system_hold) {
|
||||||
system_layout.addWidget(widget);
|
system_layout.addWidget(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ static void PopulateResolutionComboBox(QComboBox* screenshot_height, QWidget* pa
|
||||||
const auto& enumeration =
|
const auto& enumeration =
|
||||||
Settings::EnumMetadata<Settings::ResolutionSetup>::Canonicalizations();
|
Settings::EnumMetadata<Settings::ResolutionSetup>::Canonicalizations();
|
||||||
std::set<u32> resolutions{};
|
std::set<u32> resolutions{};
|
||||||
for (const auto& [name, value] : enumeration) {
|
for (const auto& [_, value] : enumeration) {
|
||||||
const float up_factor = GetUpFactor(value);
|
const float up_factor = GetUpFactor(value);
|
||||||
u32 height_undocked = Layout::ScreenUndocked::Height * up_factor;
|
u32 height_undocked = Layout::ScreenUndocked::Height * up_factor;
|
||||||
u32 height_docked = Layout::ScreenDocked::Height * up_factor;
|
u32 height_docked = Layout::ScreenDocked::Height * up_factor;
|
||||||
|
|
|
@ -61,7 +61,7 @@ std::vector<std::string> InputProfiles::GetInputProfileNames() {
|
||||||
|
|
||||||
auto it = map_profiles.cbegin();
|
auto it = map_profiles.cbegin();
|
||||||
while (it != map_profiles.cend()) {
|
while (it != map_profiles.cend()) {
|
||||||
const auto& [profile_name, config] = *it;
|
const auto& [profile_name, _] = *it;
|
||||||
if (!ProfileExistsInFilesystem(profile_name)) {
|
if (!ProfileExistsInFilesystem(profile_name)) {
|
||||||
it = map_profiles.erase(it);
|
it = map_profiles.erase(it);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -135,7 +135,7 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
|
||||||
const ComboboxTranslations* enumeration{nullptr};
|
const ComboboxTranslations* enumeration{nullptr};
|
||||||
if (combobox_enumerations.contains(type)) {
|
if (combobox_enumerations.contains(type)) {
|
||||||
enumeration = &combobox_enumerations.at(type);
|
enumeration = &combobox_enumerations.at(type);
|
||||||
for (const auto& [id, name] : *enumeration) {
|
for (const auto& [_, name] : *enumeration) {
|
||||||
combobox->addItem(name);
|
combobox->addItem(name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -223,7 +223,7 @@ QWidget* Widget::CreateRadioGroup(std::function<std::string()>& serializer,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Settings::IsConfiguringGlobal()) {
|
if (!Settings::IsConfiguringGlobal()) {
|
||||||
for (const auto& [id, button] : radio_buttons) {
|
for (const auto& [_, button] : radio_buttons) {
|
||||||
QObject::connect(button, &QAbstractButton::clicked, [touch]() { touch(); });
|
QObject::connect(button, &QAbstractButton::clicked, [touch]() { touch(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ std::optional<std::filesystem::path> GetCurrentUserPlayTimePath(
|
||||||
std::vector<PlayTimeElement> elements;
|
std::vector<PlayTimeElement> elements;
|
||||||
elements.reserve(play_time_db.size());
|
elements.reserve(play_time_db.size());
|
||||||
|
|
||||||
for (auto& [program_id, play_time] : play_time_db) {
|
for (const auto& [program_id, play_time] : play_time_db) {
|
||||||
if (program_id != 0) {
|
if (program_id != 0) {
|
||||||
elements.push_back(PlayTimeElement{program_id, play_time});
|
elements.push_back(PlayTimeElement{program_id, play_time});
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] unsigned Count() const noexcept {
|
[[nodiscard]] unsigned Count() const noexcept {
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
for (const auto& [index, value] : page_table) {
|
for (const auto& [_, value] : page_table) {
|
||||||
count += value;
|
count += value;
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
// Vic does not know which nvdec is producing frames for it, so search all the fds here for
|
// Vic does not know which nvdec is producing frames for it, so search all the fds here for
|
||||||
// the given offset.
|
// the given offset.
|
||||||
for (auto& map : m_presentation_order) {
|
for (auto& map : m_presentation_order) {
|
||||||
for (auto& [offset, frame] : map.second) {
|
for (auto& [offset, _] : map.second) {
|
||||||
if (offset == search_offset) {
|
if (offset == search_offset) {
|
||||||
return map.first;
|
return map.first;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& map : m_decode_order) {
|
for (auto& map : m_decode_order) {
|
||||||
for (auto& [offset, frame] : map.second) {
|
for (auto& [offset, _] : map.second) {
|
||||||
if (offset == search_offset) {
|
if (offset == search_offset) {
|
||||||
return map.first;
|
return map.first;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue