Skip to content

Commit 4aea16f

Browse files
committed
src: rename confusingly named local variable
Rename `val_` to `string`. The underscore suffix is normally reserved for data members, not locals, and it's not a great name in the first place. PR-URL: #1042 Reviewed-By: Trevor Norris <[email protected]>
1 parent c9ee654 commit 4aea16f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/util.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle<v8::Value> value)
88
if (value.IsEmpty())
99
return;
1010

11-
v8::Local<v8::String> val_ = value->ToString(isolate);
12-
if (val_.IsEmpty())
11+
v8::Local<v8::String> string = value->ToString(isolate);
12+
if (string.IsEmpty())
1313
return;
1414

1515
// Allocate enough space to include the null terminator
16-
size_t len = StringBytes::StorageSize(val_, UTF8) + 1;
16+
size_t len = StringBytes::StorageSize(string, UTF8) + 1;
1717
if (len > sizeof(str_st_)) {
1818
str_ = static_cast<char*>(malloc(len));
1919
CHECK_NE(str_, nullptr);
2020
}
2121

2222
const int flags =
2323
v8::String::NO_NULL_TERMINATION | v8::String::REPLACE_INVALID_UTF8;
24-
length_ = val_->WriteUtf8(str_, len, 0, flags);
24+
length_ = string->WriteUtf8(str_, len, 0, flags);
2525
str_[length_] = '\0';
2626
}
2727

0 commit comments

Comments
 (0)