From 4aea16f21419a2784d2af520eed30d80b75a1607 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 3 Mar 2015 15:20:54 +0100 Subject: [PATCH] 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: https://github.com/iojs/io.js/pull/1042 Reviewed-By: Trevor Norris --- src/util.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util.cc b/src/util.cc index a0bd077a93..f382b3d565 100644 --- a/src/util.cc +++ b/src/util.cc @@ -8,12 +8,12 @@ Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle value) if (value.IsEmpty()) return; - v8::Local val_ = value->ToString(isolate); - if (val_.IsEmpty()) + v8::Local string = value->ToString(isolate); + if (string.IsEmpty()) return; // Allocate enough space to include the null terminator - size_t len = StringBytes::StorageSize(val_, UTF8) + 1; + size_t len = StringBytes::StorageSize(string, UTF8) + 1; if (len > sizeof(str_st_)) { str_ = static_cast(malloc(len)); CHECK_NE(str_, nullptr); @@ -21,7 +21,7 @@ Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle value) const int flags = v8::String::NO_NULL_TERMINATION | v8::String::REPLACE_INVALID_UTF8; - length_ = val_->WriteUtf8(str_, len, 0, flags); + length_ = string->WriteUtf8(str_, len, 0, flags); str_[length_] = '\0'; }