refactor: using int16_t for eval values#358
Conversation
| objects to be transparently compared as integers. | ||
| */ | ||
| constexpr operator int() const noexcept { return value; } // NOLINT; | ||
| constexpr operator Value() const noexcept { return value; } // NOLINT; |
Check notice
Code scanning / CodeQL
Commented-out code
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
To fix the problem, the comment on line 74 (// NOLINT;) should be changed or removed. Since the preceding line is constexpr operator Value() const noexcept { return value; }, which is a typical spot for clang-tidy or other static analyzers to issue warnings about implicit conversion operators, the intent is likely to suppress such a warning. The fix is to use the correct suppression format: standard C++ tools accept // NOLINT alone as the annotation. Thus, the change is to replace // NOLINT; with // NOLINT and ensure no commented-out code or confusing punctuation remains. The relevant region in libbenbot/include/libbenbot/eval/Score.hpp is line 74; no other changes are needed.
| @@ -71,7 +71,7 @@ | ||
| This method is intentionally not explicit, which allows score | ||
| objects to be transparently compared as integers. | ||
| */ | ||
| constexpr operator Value() const noexcept { return value; } // NOLINT; | ||
| constexpr operator Value() const noexcept { return value; } // NOLINT | ||
|
|
||
| /** Inverts the score. */ | ||
| [[nodiscard]] constexpr auto operator-() const noexcept -> Score { return { static_cast<Value>(-value) }; } |
No description provided.