diff options
| author | Stefan Boberg <[email protected]> | 2021-08-20 13:54:05 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-08-20 13:54:05 +0200 |
| commit | 25dc6d46f65f0f3d20a5ad1da573f9267f2af2c2 (patch) | |
| tree | c79f022ae3574aae7b803c84f0b07a4fe3b4adcd /zencore | |
| parent | CL16570338: CompactBinary: Added validation to LoadCompactBinary and removed ... (diff) | |
| download | zen-25dc6d46f65f0f3d20a5ad1da573f9267f2af2c2.tar.xz zen-25dc6d46f65f0f3d20a5ad1da573f9267f2af2c2.zip | |
clang-format
Diffstat (limited to 'zencore')
| -rw-r--r-- | zencore/compactbinary.cpp | 4 | ||||
| -rw-r--r-- | zencore/include/zencore/compactbinary.h | 5 | ||||
| -rw-r--r-- | zencore/include/zencore/uid.h | 6 | ||||
| -rw-r--r-- | zencore/uid.cpp | 6 |
4 files changed, 9 insertions, 12 deletions
diff --git a/zencore/compactbinary.cpp b/zencore/compactbinary.cpp index 73ca9832f..b759e219e 100644 --- a/zencore/compactbinary.cpp +++ b/zencore/compactbinary.cpp @@ -2,10 +2,10 @@ #include "zencore/compactbinary.h" -#include "zencore/compactbinaryvalidation.h" #include <zencore/endian.h> #include <zencore/stream.h> #include <zencore/trace.h> +#include "zencore/compactbinaryvalidation.h" #include <doctest/doctest.h> #include <string_view> @@ -1091,7 +1091,7 @@ LoadCompactBinary(BinaryReader& Ar, BufferAllocator Allocator) } if (ValidateCompactBinary(Buffer, CbValidateMode::Default) != CbValidateError::None) { - return CbField(); + return CbField(); } return CbField(SharedBuffer(std::move(Buffer))); } diff --git a/zencore/include/zencore/compactbinary.h b/zencore/include/zencore/compactbinary.h index 4c9b48d3a..2dc9c0ce0 100644 --- a/zencore/include/zencore/compactbinary.h +++ b/zencore/include/zencore/compactbinary.h @@ -297,10 +297,7 @@ public: static constexpr inline bool IsFloat(CbFieldType Type) { return (Type & FloatMask) == FloatBase; } static constexpr inline bool IsBool(CbFieldType Type) { return (Type & BoolMask) == BoolBase; } - static constexpr inline bool IsObjectAttachment(CbFieldType Type) - { - return GetType(Type) == CbFieldType::ObjectAttachment; - } + static constexpr inline bool IsObjectAttachment(CbFieldType Type) { return GetType(Type) == CbFieldType::ObjectAttachment; } static constexpr inline bool IsBinaryAttachment(CbFieldType Type) { return GetType(Type) == CbFieldType::BinaryAttachment; } static constexpr inline bool IsAttachment(CbFieldType Type) { return (Type & AttachmentMask) == AttachmentBase; } diff --git a/zencore/include/zencore/uid.h b/zencore/include/zencore/uid.h index 2e2871910..2730b1415 100644 --- a/zencore/include/zencore/uid.h +++ b/zencore/include/zencore/uid.h @@ -42,9 +42,9 @@ class StringBuilderBase; ordered lexicographically. I.e they are in big-endian byte order. NOTE: The information above is only meant to explain the properties of - the identifiers. Client code should simply treat the identifier as an - opaque value and may not make any assumptions on the structure, as there - may be other ways of generating the identifiers in the future if an + the identifiers. Client code should simply treat the identifier as an + opaque value and may not make any assumptions on the structure, as there + may be other ways of generating the identifiers in the future if an application benefits. */ diff --git a/zencore/uid.cpp b/zencore/uid.cpp index b22ac7896..644d0aa77 100644 --- a/zencore/uid.cpp +++ b/zencore/uid.cpp @@ -35,7 +35,7 @@ Oid::Initialize() if (!detail::OidInitialised) { std::random_device Rng; - detail::RunId = Rng(); + detail::RunId = Rng(); detail::Serial = Rng(); detail::OidInitialised = true; @@ -50,8 +50,8 @@ Oid::Generate() Oid::Initialize(); } - const uint64_t kOffset = 1'609'459'200; // Seconds from 1970 -> 2021 - const uint64_t Time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()) - kOffset; + const uint64_t kOffset = 1'609'459'200; // Seconds from 1970 -> 2021 + const uint64_t Time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()) - kOffset; OidBits[0] = ToNetworkOrder(uint32_t(Time)); OidBits[1] = ToNetworkOrder(uint32_t(++detail::Serial)); |