Skip to content

Commit 1d34d6b

Browse files
authored
Apply suggestions from code review
Co-authored-by: Robert Nagy <[email protected]>
1 parent e4bbd84 commit 1d34d6b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/node_buffer.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,8 +995,7 @@ void IndexOfString(const FunctionCallbackInfo<Value>& args) {
995995
if (needle_length == 0) {
996996
// Match String#indexOf() and String#lastIndexOf() behavior,
997997
// but clamp to search_end.
998-
int64_t clamped =
999-
std::min(opt_offset, static_cast<int64_t>(search_end));
998+
int64_t clamped = std::min(opt_offset, static_cast<int64_t>(search_end));
1000999
args.GetReturnValue().Set(static_cast<double>(clamped));
10011000
return;
10021001
}
@@ -1123,8 +1122,7 @@ void IndexOfBuffer(const FunctionCallbackInfo<Value>& args) {
11231122
if (needle_length == 0) {
11241123
// Match String#indexOf() and String#lastIndexOf() behavior,
11251124
// but clamp to search_end.
1126-
int64_t clamped =
1127-
std::min(opt_offset, static_cast<int64_t>(search_end));
1125+
int64_t clamped = std::min(opt_offset, static_cast<int64_t>(search_end));
11281126
args.GetReturnValue().Set(static_cast<double>(clamped));
11291127
return;
11301128
}

0 commit comments

Comments
 (0)