From 9a3f5abb7c95e7dca1658d2e2d6796e0742f8fe2 Mon Sep 17 00:00:00 2001 From: Orange Date: Sun, 4 Jan 2026 11:56:15 +0300 Subject: [PATCH] added check --- include/omath/containers/encrypted_variable.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/omath/containers/encrypted_variable.hpp b/include/omath/containers/encrypted_variable.hpp index dbd7fcf..5956a53 100644 --- a/include/omath/containers/encrypted_variable.hpp +++ b/include/omath/containers/encrypted_variable.hpp @@ -123,6 +123,8 @@ namespace omath } OMATH_FORCEINLINE constexpr void decrypt() { + if (m_is_encrypted) + return; std::span bytes{reinterpret_cast(&m_data), sizeof(m_data)}; for (size_t i = 0; i < bytes.size(); ++i) @@ -131,6 +133,8 @@ namespace omath } OMATH_FORCEINLINE constexpr void encrypt() { + if (!m_is_encrypted) + return; std::span bytes{reinterpret_cast(&m_data), sizeof(m_data)}; for (size_t i = 0; i < bytes.size(); ++i)