From: Jakub Skowron Date: Wed, 17 Jan 2018 14:43:31 +0000 (+0100) Subject: [Filesystem] Speed up conversion to octet in writeBytes X-Git-Tag: submit/tizen_3.0/20180122.134630~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b63d0e1c8ac71a09cf88b16aa6ddfe5c6e55db35;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Filesystem] Speed up conversion to octet in writeBytes Do not use validateArgs to validate each value in array Change-Id: I9ac59f59187c7f57a0213778d0f2552cb9de4538 Signed-off-by: Jakub Skowron --- diff --git a/src/filesystem/js/file_stream.js b/src/filesystem/js/file_stream.js index 954ef495..07e7fca1 100644 --- a/src/filesystem/js/file_stream.js +++ b/src/filesystem/js/file_stream.js @@ -124,7 +124,7 @@ function binary_to_string( data ) { var zero = String.fromCharCode(0x100); var b; for( var i = 0; i < len; i++ ) { - b = data[i]; + b = data[i] & 0xFF; // conversion to octet output += b == 0 ? zero : String.fromCharCode(b); } return output; @@ -281,7 +281,7 @@ function writeBytes() { { name: 'byteData', type: types_.ARRAY, - values: types_.OCTET + values: undefined /* was types_.OCTET, but checking moved to binary_to_string for performance */ } ]);