Skip to content

Commit 835df97

Browse files
authored
Update xembind.cpp
1 parent a32076d commit 835df97

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/xembind.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,12 @@ namespace xeus
3939
// the typed array an be of any type
4040
ems::val js_array = buffers_vec[i];
4141

42-
// this might be a data-view..
43-
const std::string cls_name = js_array["constructor"]["name"].as<std::string>();
44-
const auto is_data_view = cls_name == std::string("DataView");
45-
46-
4742
// data we need to convert js_array into an js Uint8Arra
4843
ems::val js_array_buffer = js_array["buffer"].as<ems::val>();
4944
ems::val byteOffset = js_array["byteOffset"].as<ems::val>();
5045
const unsigned length = js_array["length"].as<unsigned> ();
51-
52-
// if its a data view we can/need to get the byteLength directly
53-
// because there is no "BYTES_PER_ELEMENT"
54-
const unsigned length_uint8 = is_data_view ? js_array["byteLength"].as<unsigned>() : length * js_array["BYTES_PER_ELEMENT"].as<unsigned>() ;
46+
const unsigned length_uint8 = js_array["byteLength"].as<unsigned>();
5547

56-
5748
// convert js typed-array into an Uint8Array
5849
ems::val js_uint8array = ems::val::global("Uint8Array").new_(
5950
js_array_buffer,

0 commit comments

Comments
 (0)