Skip to content

Commit f62a06c

Browse files
committed
constructor cleared
1 parent 0611f52 commit f62a06c

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/arraywrapper.cpp

+2-19
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ void ArrayWrapper::New(const v8::FunctionCallbackInfo<v8::Value>& args)
243243
try
244244
{
245245
ArrayWrapper* instance = nullptr;
246-
int buffIdx = -1;
247246
try
248247
{
249248
if (args.Length() == 0)
@@ -261,21 +260,8 @@ void ArrayWrapper::New(const v8::FunctionCallbackInfo<v8::Value>& args)
261260
else
262261
{
263262
Guard();
264-
for (int i = 0; i < args.Length(); i++)
265-
{
266-
if (Buffer::HasInstance(args[i]))
267-
{
268-
buffIdx = i;
269-
break;
270-
}
271-
}
272-
273-
if (buffIdx == -1)
274-
{
275-
// Creating new
276-
auto dimAndType = ParseDimAndTypeArgs(args);
277-
instance = new ArrayWrapper(new af::array(dimAndType.first, dimAndType.second));
278-
}
263+
auto dimAndType = ParseDimAndTypeArgs(args);
264+
instance = new ArrayWrapper(new af::array(dimAndType.first, dimAndType.second));
279265
}
280266
}
281267
catch (...)
@@ -290,9 +276,6 @@ void ArrayWrapper::New(const v8::FunctionCallbackInfo<v8::Value>& args)
290276
}
291277

292278
instance->Wrap(args.Holder());
293-
294-
//Set instance props: NanObjectWrapHandle(obj)->Set(NanNew(symbol), value);
295-
296279
NanReturnValue(args.Holder());
297280
}
298281
ARRAYFIRE_CATCH

0 commit comments

Comments
 (0)