summaryrefslogtreecommitdiff
path: root/src/node_buffer.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-04-30 16:17:57 +0200
committerJames M Snell <jasnell@gmail.com>2017-05-02 14:19:51 -0700
commit9d723e85fb5845f9f32d0c529af20a10455bcd8f (patch)
tree2945c200bce4480ee505b749387e30cb9a25f9a7 /src/node_buffer.cc
parent20e27dd849ab918d0926be3a79c6a7b187920914 (diff)
downloadandroid-node-v8-9d723e85fb5845f9f32d0c529af20a10455bcd8f.tar.gz
android-node-v8-9d723e85fb5845f9f32d0c529af20a10455bcd8f.tar.bz2
android-node-v8-9d723e85fb5845f9f32d0c529af20a10455bcd8f.zip
buffer: remove pointless C++ utility methods
PR-URL: https://github.com/nodejs/node/pull/12760 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_buffer.cc')
-rw-r--r--src/node_buffer.cc86
1 files changed, 13 insertions, 73 deletions
diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index e8d70d329a..e8d4945194 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -516,36 +516,6 @@ void StringSlice<UCS2>(const FunctionCallbackInfo<Value>& args) {
}
-void Latin1Slice(const FunctionCallbackInfo<Value>& args) {
- StringSlice<LATIN1>(args);
-}
-
-
-void AsciiSlice(const FunctionCallbackInfo<Value>& args) {
- StringSlice<ASCII>(args);
-}
-
-
-void Utf8Slice(const FunctionCallbackInfo<Value>& args) {
- StringSlice<UTF8>(args);
-}
-
-
-void Ucs2Slice(const FunctionCallbackInfo<Value>& args) {
- StringSlice<UCS2>(args);
-}
-
-
-void HexSlice(const FunctionCallbackInfo<Value>& args) {
- StringSlice<HEX>(args);
-}
-
-
-void Base64Slice(const FunctionCallbackInfo<Value>& args) {
- StringSlice<BASE64>(args);
-}
-
-
// bytesCopied = copy(buffer, target[, targetStart][, sourceStart][, sourceEnd])
void Copy(const FunctionCallbackInfo<Value> &args) {
Environment* env = Environment::GetCurrent(args);
@@ -712,36 +682,6 @@ void StringWrite(const FunctionCallbackInfo<Value>& args) {
}
-void Base64Write(const FunctionCallbackInfo<Value>& args) {
- StringWrite<BASE64>(args);
-}
-
-
-void Latin1Write(const FunctionCallbackInfo<Value>& args) {
- StringWrite<LATIN1>(args);
-}
-
-
-void Utf8Write(const FunctionCallbackInfo<Value>& args) {
- StringWrite<UTF8>(args);
-}
-
-
-void Ucs2Write(const FunctionCallbackInfo<Value>& args) {
- StringWrite<UCS2>(args);
-}
-
-
-void HexWrite(const FunctionCallbackInfo<Value>& args) {
- StringWrite<HEX>(args);
-}
-
-
-void AsciiWrite(const FunctionCallbackInfo<Value>& args) {
- StringWrite<ASCII>(args);
-}
-
-
static inline void Swizzle(char* start, unsigned int len) {
char* end = start + len - 1;
while (start < end) {
@@ -1222,19 +1162,19 @@ void SetupBufferJS(const FunctionCallbackInfo<Value>& args) {
Local<Object> proto = args[0].As<Object>();
env->set_buffer_prototype_object(proto);
- env->SetMethod(proto, "asciiSlice", AsciiSlice);
- env->SetMethod(proto, "base64Slice", Base64Slice);
- env->SetMethod(proto, "latin1Slice", Latin1Slice);
- env->SetMethod(proto, "hexSlice", HexSlice);
- env->SetMethod(proto, "ucs2Slice", Ucs2Slice);
- env->SetMethod(proto, "utf8Slice", Utf8Slice);
-
- env->SetMethod(proto, "asciiWrite", AsciiWrite);
- env->SetMethod(proto, "base64Write", Base64Write);
- env->SetMethod(proto, "latin1Write", Latin1Write);
- env->SetMethod(proto, "hexWrite", HexWrite);
- env->SetMethod(proto, "ucs2Write", Ucs2Write);
- env->SetMethod(proto, "utf8Write", Utf8Write);
+ env->SetMethod(proto, "asciiSlice", StringSlice<ASCII>);
+ env->SetMethod(proto, "base64Slice", StringSlice<BASE64>);
+ env->SetMethod(proto, "latin1Slice", StringSlice<LATIN1>);
+ env->SetMethod(proto, "hexSlice", StringSlice<HEX>);
+ env->SetMethod(proto, "ucs2Slice", StringSlice<UCS2>);
+ env->SetMethod(proto, "utf8Slice", StringSlice<UTF8>);
+
+ env->SetMethod(proto, "asciiWrite", StringWrite<ASCII>);
+ env->SetMethod(proto, "base64Write", StringWrite<BASE64>);
+ env->SetMethod(proto, "latin1Write", StringWrite<LATIN1>);
+ env->SetMethod(proto, "hexWrite", StringWrite<HEX>);
+ env->SetMethod(proto, "ucs2Write", StringWrite<UCS2>);
+ env->SetMethod(proto, "utf8Write", StringWrite<UTF8>);
if (auto zero_fill_field = env->isolate_data()->zero_fill_field()) {
CHECK(args[1]->IsObject());