Skip to content

Commit 4c967b7

Browse files
anonrigtargos
authored andcommitted
buffer: use constexpr where possible
PR-URL: #58141 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
1 parent 7e4453f commit 4c967b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_buffer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,9 +1452,9 @@ uint32_t WriteOneByteString(const char* src,
14521452
return 0;
14531453
}
14541454

1455-
if (encoding == UTF8) {
1455+
if constexpr (encoding == UTF8) {
14561456
return simdutf::convert_latin1_to_utf8_safe(src, src_len, dst, dst_len);
1457-
} else if (encoding == LATIN1 || encoding == ASCII) {
1457+
} else if constexpr (encoding == LATIN1 || encoding == ASCII) {
14581458
const auto size = std::min(src_len, dst_len);
14591459
memcpy(dst, src, size);
14601460
return size;

0 commit comments

Comments
 (0)