From ef0926ce428ca30baddbf6c10e3d6423bd499fbc Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 26 May 2013 21:21:57 +0200 Subject: [PATCH] os: use IsBigEndian() in GetEndianness() function --- src/node_os.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/node_os.cc b/src/node_os.cc index 1d6af2f9cab..9bff7e6b0bc 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -50,10 +50,7 @@ using namespace v8; static Handle GetEndianness(const Arguments& args) { HandleScope scope(node_isolate); - int i = 1; - bool big = (*(char *)&i) == 0; - Local endianness = String::New(big ? "BE" : "LE"); - return scope.Close(endianness); + return scope.Close(String::New(IsBigEndian() ? "BE" : "LE")); } static Handle GetHostname(const Arguments& args) {