Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changes suggested by @bnoordhuis

  • Loading branch information...
commit 19c9f106268e1ee3cdcdd735a5942d2fde40f31f 1 parent 5245e90
@langpavel authored
Showing with 4 additions and 7 deletions.
  1. +3 −3 src/node_buffer.cc
  2. +1 −4 src/node_buffer.h
View
6 src/node_buffer.cc
@@ -145,7 +145,7 @@ Buffer* Buffer::New(const char* data, size_t length) {
Buffer *buffer = ObjectWrap::Unwrap<Buffer>(obj);
// if replace have no callback, it's copied
- buffer->Replace(data, length);
+ buffer->Replace(const_cast<char*>(data), length, NULL, NULL);
return buffer;
}
@@ -199,8 +199,8 @@ Buffer::~Buffer() {
}
-// if replace have no callback, data must be copied
-// const_cast in Buffer::New require this
+// if replace doesn't have a callback, data must be copied
+// const_cast in Buffer::New requires this
void Buffer::Replace(char *data, size_t length,
free_callback callback, void *hint) {
HandleScope scope;
View
5 src/node_buffer.h
@@ -105,7 +105,7 @@ class NODE_EXTERN Buffer: public ObjectWrap {
// public constructor
static Buffer* New(size_t length);
- // public constructor - data are copied
+ // public constructor - data is copied
static Buffer* New(const char *data, size_t len);
// public constructor
static Buffer* New(char *data, size_t length,
@@ -130,9 +130,6 @@ class NODE_EXTERN Buffer: public ObjectWrap {
Buffer(v8::Handle<v8::Object> wrapper, size_t length);
- inline void Replace(const char *data, size_t length) {
- Replace(const_cast<char*>(data), length, NULL, NULL);
- };
void Replace(char *data, size_t length, free_callback callback, void *hint);
size_t length_;
Please sign in to comment.
Something went wrong with that request. Please try again.