diff --git a/lib/V8/v8-conv.cpp b/lib/V8/v8-conv.cpp index dd0e207652..5042cb6a38 100644 --- a/lib/V8/v8-conv.cpp +++ b/lib/V8/v8-conv.cpp @@ -496,12 +496,11 @@ std::string TRI_ObjectToString(v8::Handle const value) { int64_t TRI_ObjectToInt64(v8::Handle const value) { if (value->IsNumber()) { - return (int64_t)value->ToNumber()->Value(); + return static_cast(value->ToNumber()->Value()); } if (value->IsNumberObject()) { - v8::Handle no = v8::Handle::Cast(value); - return (int64_t)no->NumberValue(); + return static_cast(v8::Handle::Cast(value)->NumberValue()); } return 0; @@ -512,14 +511,13 @@ int64_t TRI_ObjectToInt64(v8::Handle const value) { //////////////////////////////////////////////////////////////////////////////// uint64_t TRI_ObjectToUInt64(v8::Handle const value, - bool const allowStringConversion) { + bool allowStringConversion) { if (value->IsNumber()) { - return (uint64_t)value->ToNumber()->Value(); + return static_cast(value->ToNumber()->Value()); } if (value->IsNumberObject()) { - v8::Handle no = v8::Handle::Cast(value); - return (uint64_t)no->NumberValue(); + return static_cast(v8::Handle::Cast(value)->NumberValue()); } if (allowStringConversion && value->IsString()) { @@ -540,8 +538,7 @@ double TRI_ObjectToDouble(v8::Handle const value) { } if (value->IsNumberObject()) { - v8::Handle no = v8::Handle::Cast(value); - return no->NumberValue(); + return v8::Handle::Cast(value)->NumberValue(); } return 0.0; @@ -559,8 +556,7 @@ double TRI_ObjectToDouble(v8::Handle const value, bool& error) { } if (value->IsNumberObject()) { - v8::Handle no = v8::Handle::Cast(value); - return no->NumberValue(); + return v8::Handle::Cast(value)->NumberValue(); } error = true; @@ -575,10 +571,10 @@ double TRI_ObjectToDouble(v8::Handle const value, bool& error) { bool TRI_ObjectToBoolean(v8::Handle const value) { if (value->IsBoolean()) { return value->ToBoolean()->Value(); - } else if (value->IsBooleanObject()) { - v8::Handle bo = - v8::Handle::Cast(value); - return bo->BooleanValue(); + } + + if (value->IsBooleanObject()) { + return v8::Handle::Cast(value)->BooleanValue(); } return false; diff --git a/lib/V8/v8-conv.h b/lib/V8/v8-conv.h index 0adab0f551..caa5320a55 100644 --- a/lib/V8/v8-conv.h +++ b/lib/V8/v8-conv.h @@ -68,7 +68,7 @@ int64_t TRI_ObjectToInt64(v8::Handle const); /// @brief converts an V8 object to a uint64_t //////////////////////////////////////////////////////////////////////////////// -uint64_t TRI_ObjectToUInt64(v8::Handle const, bool const); +uint64_t TRI_ObjectToUInt64(v8::Handle const, bool); //////////////////////////////////////////////////////////////////////////////// /// @brief converts a V8 object to a double