Skip to content
Browse files

use memset

  • Loading branch information...
1 parent e07af59 commit ec467748470f0ffb876c23bea5f2a4d7bfff9114 @xk committed
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/node_buffer.cc
View
5 src/node_buffer.cc
@@ -192,10 +192,7 @@ void Buffer::Replace(char *data, size_t length,
memcpy(data_, data, length_);
}
else {
- size_t n = length_;
- while (n--) {
- data_[n]= 0;
- }
+ memset( (void*)(data_), 0, length_);
}
V8::AdjustAmountOfExternalAllocatedMemory(sizeof(Buffer) + length_);
} else {

0 comments on commit ec46774

Please sign in to comment.
Something went wrong with that request. Please try again.