From 2b75b33d602829fe7cf15776b166f78d06f56625 Mon Sep 17 00:00:00 2001 From: Orange Date: Sun, 4 Jan 2026 12:01:24 +0300 Subject: [PATCH] fix --- include/omath/containers/encrypted_variable.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/omath/containers/encrypted_variable.hpp b/include/omath/containers/encrypted_variable.hpp index 5956a53..08cca91 100644 --- a/include/omath/containers/encrypted_variable.hpp +++ b/include/omath/containers/encrypted_variable.hpp @@ -109,11 +109,11 @@ namespace omath template key> class EncryptedVariable final { - bool m_is_encrypted{}; + bool m_is_encrypted; T m_data; public: - OMATH_FORCEINLINE constexpr explicit EncryptedVariable(const T& data): m_is_encrypted(true), m_data(data) + OMATH_FORCEINLINE constexpr explicit EncryptedVariable(const T& data): m_is_encrypted(false), m_data(data) { encrypt(); } @@ -123,7 +123,7 @@ namespace omath } OMATH_FORCEINLINE constexpr void decrypt() { - if (m_is_encrypted) + if (!m_is_encrypted) return; std::span bytes{reinterpret_cast(&m_data), sizeof(m_data)}; @@ -133,7 +133,7 @@ namespace omath } OMATH_FORCEINLINE constexpr void encrypt() { - if (!m_is_encrypted) + if (m_is_encrypted) return; std::span bytes{reinterpret_cast(&m_data), sizeof(m_data)};