diff --git a/rpcs3/Loader/PSF.cpp b/rpcs3/Loader/PSF.cpp index 28c08d7b8c..2efa896109 100644 --- a/rpcs3/Loader/PSF.cpp +++ b/rpcs3/Loader/PSF.cpp @@ -396,24 +396,13 @@ namespace psf return found->second.as_integer(); } - bool check_registry(const registry& psf, std::function validate, std::source_location src_loc) + bool check_registry(const registry& psf, std::source_location src_loc) { bool psf_ok = true; for (const auto& [key, value] : psf) { - bool entry_ok = value.is_valid(); - - if (validate) - { - // Validate against a custom condition as well (forward error) - if (!validate(entry_ok, key, value)) - { - entry_ok = false; - } - } - - if (!entry_ok) + if (!value.is_valid()) { if (value.type() == format::string) { @@ -424,10 +413,7 @@ namespace psf // TODO: Better logging of other types psf_log.error("Entry %s is invalid.%s", key, value.as_string(), src_loc); } - } - if (!entry_ok) - { // Do not break, run over all entries in order to report all errors psf_ok = false; } diff --git a/rpcs3/Loader/PSF.h b/rpcs3/Loader/PSF.h index 9cc8b16c19..d4d93e713e 100644 --- a/rpcs3/Loader/PSF.h +++ b/rpcs3/Loader/PSF.h @@ -103,7 +103,7 @@ namespace psf // Get integer value or default value u32 get_integer(const registry& psf, std::string_view key, u32 def = 0); - bool check_registry(const registry& psf, std::function validate = {}, std::source_location src_loc = std::source_location::current()); + bool check_registry(const registry& psf, std::source_location src_loc = std::source_location::current()); // Assign new entry inline void assign(registry& psf, std::string_view key, entry&& _entry) diff --git a/rpcs3/Loader/TAR.cpp b/rpcs3/Loader/TAR.cpp index 7cd25c6f1f..4eb568c3b7 100644 --- a/rpcs3/Loader/TAR.cpp +++ b/rpcs3/Loader/TAR.cpp @@ -565,11 +565,11 @@ void tar_object::save_directory(const std::string& target_path, utils::serial& a } }; - auto save_header = [&](const fs::stat_t& stat, const std::string& name) + auto save_header = [&](const fs::stat_t& stat, std::string_view name) { static_assert(sizeof(TARHeader) == 512); - std::string_view saved_path{name.size() == src_dir_pos ? name.c_str() : &::at32(name, src_dir_pos), name.size() - src_dir_pos}; + std::string_view saved_path = name.size() == src_dir_pos ? name : name.substr(src_dir_pos); if (is_null) {