Skip to content

Commit d56a5e4

Browse files
anonrigaduh95
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 34a9b85 commit d56a5e4

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
@@ -1441,9 +1441,9 @@ uint32_t WriteOneByteString(const char* src,
14411441
return 0;
14421442
}
14431443

1444-
if (encoding == UTF8) {
1444+
if constexpr (encoding == UTF8) {
14451445
return simdutf::convert_latin1_to_utf8_safe(src, src_len, dst, dst_len);
1446-
} else if (encoding == LATIN1 || encoding == ASCII) {
1446+
} else if constexpr (encoding == LATIN1 || encoding == ASCII) {
14471447
const auto size = std::min(src_len, dst_len);
14481448
memcpy(dst, src, size);
14491449
return size;

0 commit comments

Comments
 (0)