OSDN Git Service

[Refactor] #3566 MAX_LINE_LEN 定数が1箇所でしか使われていなかったのでローカルコンパイル時定数に置換した
authorHourier <66951241+Hourier@users.noreply.github.com>
Tue, 25 Jul 2023 12:17:06 +0000 (21:17 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sun, 8 Oct 2023 05:24:43 +0000 (14:24 +0900)
src/wizard/fixed-artifacts-spoiler.cpp
src/wizard/spoiler-util.h

index 016ef0c..fd55571 100644 (file)
@@ -42,7 +42,8 @@ void spoiler_outlist(std::string_view header, const std::vector<std::string> &de
 
         const auto element_str = element.str();
         const int line_length = line.tellp();
-        if (line_length + element_str.length() <= MAX_LINE_LEN) {
+        constexpr auto max_line_length = 75;
+        if (line_length + element_str.length() <= max_line_length) {
             line << element_str;
             continue;
         }
index 986188d..54b3117 100644 (file)
@@ -8,9 +8,6 @@
 #include <string_view>
 #include <vector>
 
-/* MAX_LINE_LEN specifies when a line should wrap. */
-#define MAX_LINE_LEN 75
-
 enum class SpoilerOutputResultType {
     CANCELED,
     SUCCESSFUL,