mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
src: alias BINARY to LATIN1
Make BINARY an alias for LATIN1 rather than a distinct enum value. PR-URL: https://github.com/nodejs/node/pull/7284 Refs: https://github.com/nodejs/node/pull/7262 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This commit is contained in:
1 parent
7ba0f860a6
commit
da9bd2fc48
4 files changed
+8
-10
No files matched your search
+2
-8
@@ -283,7 +283,6 @@ size_t StringBytes::Write(Isolate* isolate,
|
||||
switch (encoding) {
|
||||
case ASCII:
|
||||
case LATIN1:
|
||||
case BINARY:
|
||||
if (is_extern && str->IsOneByte()) {
|
||||
memcpy(buf, data, nbytes);
|
||||
} else {
|
||||
@@ -388,8 +387,7 @@ size_t StringBytes::StorageSize(Isolate* isolate,
|
||||
size_t data_size = 0;
|
||||
bool is_buffer = Buffer::HasInstance(val);
|
||||
|
||||
if (is_buffer &&
|
||||
(encoding == BUFFER || encoding == BINARY || encoding == LATIN1)) {
|
||||
if (is_buffer && (encoding == BUFFER || encoding == LATIN1)) {
|
||||
return Buffer::Length(val);
|
||||
}
|
||||
|
||||
@@ -398,7 +396,6 @@ size_t StringBytes::StorageSize(Isolate* isolate,
|
||||
switch (encoding) {
|
||||
case ASCII:
|
||||
case LATIN1:
|
||||
case BINARY:
|
||||
data_size = str->Length();
|
||||
break;
|
||||
|
||||
@@ -439,8 +436,7 @@ size_t StringBytes::Size(Isolate* isolate,
|
||||
size_t data_size = 0;
|
||||
bool is_buffer = Buffer::HasInstance(val);
|
||||
|
||||
if (is_buffer &&
|
||||
(encoding == BUFFER || encoding == BINARY || encoding == LATIN1))
|
||||
if (is_buffer && (encoding == BUFFER || encoding == LATIN1))
|
||||
return Buffer::Length(val);
|
||||
|
||||
const char* data;
|
||||
@@ -452,7 +448,6 @@ size_t StringBytes::Size(Isolate* isolate,
|
||||
switch (encoding) {
|
||||
case ASCII:
|
||||
case LATIN1:
|
||||
case BINARY:
|
||||
data_size = str->Length();
|
||||
break;
|
||||
|
||||
@@ -656,7 +651,6 @@ Local<Value> StringBytes::Encode(Isolate* isolate,
|
||||
break;
|
||||
|
||||
case LATIN1:
|
||||
case BINARY:
|
||||
if (buflen < EXTERN_APEX)
|
||||
val = OneByteString(isolate, buf, buflen);
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user