Skip to content

Commit ff8652b

Browse files
committed
fix: reassign condition to ensure proper iteration when a BooleanArray
1 parent 9f4e007 commit ff8652b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • lib/node_modules/@stdlib/array/base/where/lib

lib/node_modules/@stdlib/array/base/where/lib/assign.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ function assign( condition, x, y, out, stride, offset ) {
287287

288288
co = arraylike2object( condition );
289289
if ( isBooleanDataType( co.dtype ) ) {
290-
co = arraylike2object( reinterpretBool( condition, 0 ) );
290+
condition = reinterpretBool( condition, 0 );
291+
co = arraylike2object( condition );
291292
}
292293
xo = arraylike2object( x );
293294
yo = arraylike2object( y );
@@ -305,7 +306,7 @@ function assign( condition, x, y, out, stride, offset ) {
305306
isBooleanDataType( yo.dtype ) &&
306307
isBooleanDataType( oo.dtype )
307308
) {
308-
indexed( N, co.data, reinterpretBool( x, 0 ), reinterpretBool( y, 0 ), reinterpretBool( out, 0 ), stride, offset ); // eslint-disable-line max-len
309+
indexed( N, condition, reinterpretBool( x, 0 ), reinterpretBool( y, 0 ), reinterpretBool( out, 0 ), stride, offset ); // eslint-disable-line max-len
309310
return out;
310311
}
311312
if (

0 commit comments

Comments
 (0)