summaryrefslogtreecommitdiff
path: root/src/node_os.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-05-26 21:21:57 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-05-30 00:13:04 +0200
commitef0926ce428ca30baddbf6c10e3d6423bd499fbc (patch)
treec86a046b0c9c9bf119d5b82c7c8b10c65d70d601 /src/node_os.cc
parentd02f2282635755d8ab544bf18489eac3c3c03bf6 (diff)
downloadandroid-node-v8-ef0926ce428ca30baddbf6c10e3d6423bd499fbc.tar.gz
android-node-v8-ef0926ce428ca30baddbf6c10e3d6423bd499fbc.tar.bz2
android-node-v8-ef0926ce428ca30baddbf6c10e3d6423bd499fbc.zip
os: use IsBigEndian() in GetEndianness() function
Diffstat (limited to 'src/node_os.cc')
-rw-r--r--src/node_os.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/node_os.cc b/src/node_os.cc
index 1d6af2f9ca..9bff7e6b0b 100644
--- a/src/node_os.cc
+++ b/src/node_os.cc
@@ -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) {