@@ -516,36 +516,6 @@ void StringSlice<UCS2>(const FunctionCallbackInfo<Value>& args) {
516
516
}
517
517
518
518
519
- void Latin1Slice (const FunctionCallbackInfo<Value>& args) {
520
- StringSlice<LATIN1>(args);
521
- }
522
-
523
-
524
- void AsciiSlice (const FunctionCallbackInfo<Value>& args) {
525
- StringSlice<ASCII>(args);
526
- }
527
-
528
-
529
- void Utf8Slice (const FunctionCallbackInfo<Value>& args) {
530
- StringSlice<UTF8>(args);
531
- }
532
-
533
-
534
- void Ucs2Slice (const FunctionCallbackInfo<Value>& args) {
535
- StringSlice<UCS2>(args);
536
- }
537
-
538
-
539
- void HexSlice (const FunctionCallbackInfo<Value>& args) {
540
- StringSlice<HEX>(args);
541
- }
542
-
543
-
544
- void Base64Slice (const FunctionCallbackInfo<Value>& args) {
545
- StringSlice<BASE64>(args);
546
- }
547
-
548
-
549
519
// bytesCopied = copy(buffer, target[, targetStart][, sourceStart][, sourceEnd])
550
520
void Copy (const FunctionCallbackInfo<Value> &args) {
551
521
Environment* env = Environment::GetCurrent (args);
@@ -712,36 +682,6 @@ void StringWrite(const FunctionCallbackInfo<Value>& args) {
712
682
}
713
683
714
684
715
- void Base64Write (const FunctionCallbackInfo<Value>& args) {
716
- StringWrite<BASE64>(args);
717
- }
718
-
719
-
720
- void Latin1Write (const FunctionCallbackInfo<Value>& args) {
721
- StringWrite<LATIN1>(args);
722
- }
723
-
724
-
725
- void Utf8Write (const FunctionCallbackInfo<Value>& args) {
726
- StringWrite<UTF8>(args);
727
- }
728
-
729
-
730
- void Ucs2Write (const FunctionCallbackInfo<Value>& args) {
731
- StringWrite<UCS2>(args);
732
- }
733
-
734
-
735
- void HexWrite (const FunctionCallbackInfo<Value>& args) {
736
- StringWrite<HEX>(args);
737
- }
738
-
739
-
740
- void AsciiWrite (const FunctionCallbackInfo<Value>& args) {
741
- StringWrite<ASCII>(args);
742
- }
743
-
744
-
745
685
static inline void Swizzle (char * start, unsigned int len) {
746
686
char * end = start + len - 1 ;
747
687
while (start < end) {
@@ -1222,19 +1162,19 @@ void SetupBufferJS(const FunctionCallbackInfo<Value>& args) {
1222
1162
Local<Object> proto = args[0 ].As <Object>();
1223
1163
env->set_buffer_prototype_object (proto);
1224
1164
1225
- env->SetMethod (proto, " asciiSlice" , AsciiSlice );
1226
- env->SetMethod (proto, " base64Slice" , Base64Slice );
1227
- env->SetMethod (proto, " latin1Slice" , Latin1Slice );
1228
- env->SetMethod (proto, " hexSlice" , HexSlice );
1229
- env->SetMethod (proto, " ucs2Slice" , Ucs2Slice );
1230
- env->SetMethod (proto, " utf8Slice" , Utf8Slice );
1231
-
1232
- env->SetMethod (proto, " asciiWrite" , AsciiWrite );
1233
- env->SetMethod (proto, " base64Write" , Base64Write );
1234
- env->SetMethod (proto, " latin1Write" , Latin1Write );
1235
- env->SetMethod (proto, " hexWrite" , HexWrite );
1236
- env->SetMethod (proto, " ucs2Write" , Ucs2Write );
1237
- env->SetMethod (proto, " utf8Write" , Utf8Write );
1165
+ env->SetMethod (proto, " asciiSlice" , StringSlice<ASCII> );
1166
+ env->SetMethod (proto, " base64Slice" , StringSlice<BASE64> );
1167
+ env->SetMethod (proto, " latin1Slice" , StringSlice<LATIN1> );
1168
+ env->SetMethod (proto, " hexSlice" , StringSlice<HEX> );
1169
+ env->SetMethod (proto, " ucs2Slice" , StringSlice<UCS2> );
1170
+ env->SetMethod (proto, " utf8Slice" , StringSlice<UTF8> );
1171
+
1172
+ env->SetMethod (proto, " asciiWrite" , StringWrite<ASCII> );
1173
+ env->SetMethod (proto, " base64Write" , StringWrite<BASE64> );
1174
+ env->SetMethod (proto, " latin1Write" , StringWrite<LATIN1> );
1175
+ env->SetMethod (proto, " hexWrite" , StringWrite<HEX> );
1176
+ env->SetMethod (proto, " ucs2Write" , StringWrite<UCS2> );
1177
+ env->SetMethod (proto, " utf8Write" , StringWrite<UTF8> );
1238
1178
1239
1179
if (auto zero_fill_field = env->isolate_data ()->zero_fill_field ()) {
1240
1180
CHECK (args[1 ]->IsObject ());
0 commit comments