diff options
Diffstat (limited to 'Source/Core/Common/SettingsHandler.cpp')
| -rw-r--r-- | Source/Core/Common/SettingsHandler.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/Source/Core/Common/SettingsHandler.cpp b/Source/Core/Common/SettingsHandler.cpp index e737a97620..b5c32a2099 100644 --- a/Source/Core/Common/SettingsHandler.cpp +++ b/Source/Core/Common/SettingsHandler.cpp @@ -17,14 +17,14 @@ namespace Common { -SettingsHandler::SettingsHandler() +SettingsHandler::SettingsHandler() : m_buffer{}, m_position{0}, m_key{INITIAL_SEED}, decoded{""} { - Reset(); } -SettingsHandler::SettingsHandler(const Buffer& buffer) +SettingsHandler::SettingsHandler(const Buffer& buffer) : SettingsHandler() { - SetBytes(buffer); + m_buffer = buffer; + Decrypt(); } const SettingsHandler::Buffer& SettingsHandler::GetBytes() const @@ -32,13 +32,6 @@ const SettingsHandler::Buffer& SettingsHandler::GetBytes() const return m_buffer; } -void SettingsHandler::SetBytes(const Buffer& buffer) -{ - Reset(); - m_buffer = buffer; - Decrypt(); -} - std::string SettingsHandler::GetValue(std::string_view key) const { constexpr char delim[] = "\n"; @@ -84,14 +77,6 @@ void SettingsHandler::Decrypt() std::erase(decoded, '\x0d'); } -void SettingsHandler::Reset() -{ - decoded = ""; - m_position = 0; - m_key = INITIAL_SEED; - m_buffer = {}; -} - void SettingsHandler::AddSetting(std::string_view key, std::string_view value) { WriteLine(fmt::format("{}={}\r\n", key, value)); |
