[Misc] Replaced const with constexpr where possible

This commit is contained in:
Xphalnos
2025-04-04 22:36:05 +02:00
committed by Radosław Gliński
parent c4f1bf27ef
commit 47f327e848
42 changed files with 154 additions and 152 deletions

View File

@@ -248,8 +248,8 @@ class Logger {
uint8_t buffer_[kBufferSize];
static constexpr size_t kBlockSize = 256;
static const size_t kBlockCount = kBufferSize / kBlockSize;
static const size_t kBlockIndexMask = kBlockCount - 1;
static constexpr size_t kBlockCount = kBufferSize / kBlockSize;
static constexpr size_t kBlockIndexMask = kBlockCount - 1;
static const size_t kClaimStrategyFootprint =
sizeof(std::atomic<dp::sequence_t>[kBlockCount]);
@@ -353,14 +353,14 @@ class Logger {
? line_range.second[line_range.second_length - 1]
: line_range.first[line_range.first_length - 1];
if (last_char != '\n') {
const char suffix[1] = {'\n'};
constexpr char suffix[1] = {'\n'};
Write(suffix, 1);
}
rb.EndRead(std::move(line_range));
} else {
// Always ensure there is a newline.
const char suffix[1] = {'\n'};
constexpr char suffix[1] = {'\n'};
Write(suffix, 1);
}