File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Common/Core/ClassHierarchy Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable prefer-rest-params */
2
2
export default class ClassHierarchy extends Array {
3
3
push ( ) {
4
- // using a for loop because a filter would trigger the garbage collector
5
- const newArgs = [ ] ;
6
4
for ( let i = 0 ; i < arguments . length ; i ++ ) {
7
5
if ( ! this . includes ( arguments [ i ] ) ) {
8
- newArgs . push ( arguments [ i ] ) ;
6
+ super . push ( arguments [ i ] ) ;
9
7
}
10
8
}
11
9
12
- return super . push ( ... newArgs ) ;
10
+ return this . length ;
13
11
}
14
12
}
Original file line number Diff line number Diff line change @@ -246,7 +246,11 @@ export function obj(publicAPI = {}, model = {}) {
246
246
if ( ! ( 'classHierarchy' in model ) ) {
247
247
model . classHierarchy = new ClassHierarchy ( 'vtkObject' ) ;
248
248
} else if ( ! ( model . classHierarchy instanceof ClassHierarchy ) ) {
249
- model . classHierarchy = ClassHierarchy . from ( model . classHierarchy ) ;
249
+ const hierarchy = new ClassHierarchy ( ) ;
250
+ for ( let i = 0 ; i < model . classHierarchy . length ; i ++ ) {
251
+ hierarchy . push ( model . classHierarchy [ i ] ) ;
252
+ }
253
+ model . classHierarchy = hierarchy ;
250
254
}
251
255
252
256
function off ( index ) {
You can’t perform that action at this time.
0 commit comments