mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
os: use IsBigEndian() in GetEndianness() function
This commit is contained in:
1 parent
d02f228263
commit
ef0926ce42
1 file changed
+1
-4
+1
-4
@@ -50,10 +50,7 @@ using namespace v8;
|
||||
|
||||
static Handle<Value> GetEndianness(const Arguments& args) {
|
||||
HandleScope scope(node_isolate);
|
||||
int i = 1;
|
||||
bool big = (*(char *)&i) == 0;
|
||||
Local<String> endianness = String::New(big ? "BE" : "LE");
|
||||
return scope.Close(endianness);
|
||||
return scope.Close(String::New(IsBigEndian() ? "BE" : "LE"));
|
||||
}
|
||||
|
||||
static Handle<Value> GetHostname(const Arguments& args) {
|
||||
|
||||
Reference in new issue
Block a user