From 1660db6b87703ca7c9c2ea1ac7cf3b27ea8c14bf Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 2 Feb 2010 19:35:06 -0800 Subject: [PATCH] Inline Buffer::HasInstance --- src/node_buffer.cc | 8 -------- src/node_buffer.h | 6 +++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 71afbd7156..d5b68aa7c5 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -339,14 +339,6 @@ Handle Buffer::Utf8ByteLength(const Arguments &args) { } -bool Buffer::HasInstance(Handle val) { - if (!val->IsObject()) return false; - Local obj = val->ToObject(); - return constructor_template->HasInstance(obj); -} - - - void Buffer::Initialize(Handle target) { HandleScope scope; diff --git a/src/node_buffer.h b/src/node_buffer.h index ae3b6bfbff..78059be7ef 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -31,7 +31,11 @@ struct Blob_; class Buffer : public ObjectWrap { public: static void Initialize(v8::Handle target); - static bool HasInstance(v8::Handle val); + static inline bool HasInstance(v8::Handle val) { + if (!val->IsObject()) return false; + v8::Local obj = val->ToObject(); + return constructor_template->HasInstance(obj); + } const char* data() const { return data_; } size_t length() const { return length_; }