Skip to content

Commit 0cc1451

Browse files
committed
Remove unnecessary calls to std::max()
1 parent 398a71c commit 0cc1451

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ui_api.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include "ui_local.h"
88

9-
#include <algorithm>
109
#include <filesystem>
1110
#include <fstream>
1211
#include <zlib.h>
@@ -1076,7 +1075,7 @@ static int l_DrawString(lua_State* L)
10761075
const lua_Number logicalHeight = lua_tonumber(L, 4);
10771076
int scaledHeight = (int)std::lround(logicalHeight * dpiScale);
10781077
if (scaledHeight <= 1) {
1079-
scaledHeight = std::max(1, scaledHeight);
1078+
scaledHeight = 1;
10801079
}
10811080
else {
10821081
scaledHeight = (scaledHeight + 1) & ~1;
@@ -1107,7 +1106,7 @@ static int l_DrawStringWidth(lua_State* L)
11071106
const lua_Number logicalHeight = lua_tonumber(L, 1);
11081107
int scaledHeight = static_cast<int>(std::lround(logicalHeight * dpiScale));
11091108
if (scaledHeight <= 1) {
1110-
scaledHeight = std::max(1, scaledHeight);
1109+
scaledHeight = 1;
11111110
}
11121111
else {
11131112
scaledHeight = (scaledHeight + 1) & ~1;
@@ -1138,7 +1137,7 @@ static int l_DrawStringCursorIndex(lua_State* L)
11381137
const lua_Number logicalCursorY = lua_tonumber(L, 5);
11391138
int scaledHeight = static_cast<int>(std::lround(logicalHeight * dpiScale));
11401139
if (scaledHeight <= 1) {
1141-
scaledHeight = std::max(1, scaledHeight);
1140+
scaledHeight = 1;
11421141
}
11431142
else {
11441143
scaledHeight = (scaledHeight + 1) & ~1;

0 commit comments

Comments
 (0)