@@ -362,7 +362,8 @@ function findBranchComplex(tree, name, lst = undefined, only_search = false) {
362
362
if ( pos > 0 ) search = search . slice ( 0 , pos ) ;
363
363
}
364
364
365
- if ( ! lst || ( lst . arr . length === 0 ) ) return null ;
365
+ if ( ! lst ?. arr . length )
366
+ return null ;
366
367
367
368
for ( let n = 0 ; n < lst . arr . length ; ++ n ) {
368
369
let brname = lst . arr [ n ] . fName ;
@@ -390,10 +391,9 @@ function findBranchComplex(tree, name, lst = undefined, only_search = false) {
390
391
if ( brname [ pnt - 1 ] === '.' ) pnt -- ;
391
392
if ( search [ pnt ] !== '.' ) continue ;
392
393
393
- res = findBranchComplex ( tree , search , lst . arr [ n ] . fBranches ) ;
394
- if ( ! res ) res = findBranchComplex ( tree , search . slice ( pnt + 1 ) , lst . arr [ n ] . fBranches ) ;
395
-
396
- if ( ! res ) res = { branch : lst . arr [ n ] , rest : search . slice ( pnt ) } ;
394
+ res = findBranchComplex ( tree , search , lst . arr [ n ] . fBranches ) ||
395
+ findBranchComplex ( tree , search . slice ( pnt + 1 ) , lst . arr [ n ] . fBranches ) ||
396
+ { branch : lst . arr [ n ] , rest : search . slice ( pnt ) } ;
397
397
398
398
break ;
399
399
}
@@ -1040,8 +1040,7 @@ class TDrawSelector extends TSelector {
1040
1040
this . leaf = args . leaf ;
1041
1041
1042
1042
// branch object remains, therefore we need to copy fields to see them all
1043
- this . copy_fields = ( ( args . branch . fLeaves && ( args . branch . fLeaves . arr . length > 1 ) ) ||
1044
- ( args . branch . fBranches && ( args . branch . fBranches . arr . length > 0 ) ) ) && ! args . leaf ;
1043
+ this . copy_fields = ( ( args . branch . fLeaves ?. arr . length > 1 ) || args . branch . fBranches ?. arr . length ) && ! args . leaf ;
1045
1044
1046
1045
this . addBranch ( branch , 'br0' , args . direct_branch ) ; // add branch
1047
1046
@@ -1972,9 +1971,8 @@ async function treeProcess(tree, selector, args) {
1972
1971
newtgt [ l ] = target_object [ l ] ;
1973
1972
newtgt [ newtgt . length - 1 ] = { name : target_name , lst : makeMethodsList ( object_class ) } ;
1974
1973
1975
- if ( ! scanBranches ( branch . fBranches , newtgt , 0 ) ) return null ;
1976
-
1977
- return item ; // this kind of branch does not have baskets and not need to be read
1974
+ // this kind of branch does not have baskets and not need to be read
1975
+ return scanBranches ( branch . fBranches , newtgt , 0 ) ? item : null ;
1978
1976
} else if ( is_brelem && ( nb_leaves === 1 ) && ( leaf . fName === branch . fName ) && ( branch . fID === - 1 ) ) {
1979
1977
elem = createStreamerElement ( target_name , branch . fClassName ) ;
1980
1978
@@ -2774,7 +2772,8 @@ function treeIOTest(tree, args) {
2774
2772
const branches = [ ] , names = [ ] , nchilds = [ ] ;
2775
2773
2776
2774
function collectBranches ( obj , prntname = '' ) {
2777
- if ( ! obj ?. fBranches ) return 0 ;
2775
+ if ( ! obj ?. fBranches )
2776
+ return 0 ;
2778
2777
2779
2778
let cnt = 0 ;
2780
2779
@@ -2964,7 +2963,7 @@ function treeHierarchy(tree_node, obj) {
2964
2963
tree_node . _childs = [ ] ;
2965
2964
tree_node . _tree = obj ; // set reference, will be used later by TTree::Draw
2966
2965
2967
- for ( let i = 0 ; i < obj . fBranches . arr ? .length ; ++ i )
2966
+ for ( let i = 0 ; i < obj . fBranches ? .arr . length ; ++ i )
2968
2967
createBranchItem ( tree_node , obj . fBranches . arr [ i ] , obj ) ;
2969
2968
2970
2969
return true ;
0 commit comments