@@ -563,19 +563,28 @@ TraceManager.prototype.updateSelection = function(group, keys) {
563
563
564
564
// find matches for nested keys
565
565
function findNestedMatches ( haystack , needleSet ) {
566
- var matches = [ ] ;
567
- // ensure both haystack and needleset are an array of an arrays
568
- for ( var i = 0 ; i < haystack . length ; i ++ ) {
569
- if ( ! Array . isArray ( haystack [ i ] ) ) {
570
- haystack [ i ] = [ haystack [ i ] ] ;
566
+
567
+ // ensure haystack is an array of an arrays
568
+ if ( ! Array . isArray ( haystack ) ) {
569
+ haystack = [ haystack ] ;
570
+ for ( var i = 0 ; i < haystack . length ; i ++ ) {
571
+ if ( ! Array . isArray ( haystack [ i ] ) ) {
572
+ haystack [ i ] = [ haystack [ i ] ] ;
573
+ }
571
574
}
572
575
}
573
- for ( var i = 0 ; i < needleSet . length ; i ++ ) {
574
- if ( ! Array . isArray ( needleSet [ i ] ) ) {
575
- needleSet [ i ] = [ needleSet [ i ] ] ;
576
+ // ensure needleSet is an array of an arrays
577
+ if ( ! Array . isArray ( needleSet ) ) {
578
+ needleSet = [ needleSet ] ;
579
+ for ( var i = 0 ; i < needleSet . length ; i ++ ) {
580
+ if ( ! Array . isArray ( needleSet [ i ] ) ) {
581
+ needleSet [ i ] = [ needleSet [ i ] ] ;
582
+ }
576
583
}
577
584
}
578
- // return a match if a haystack element is a subset of a
585
+
586
+ // return a match if a haystack array is a superset of a needleset array
587
+ var matches = [ ] ;
579
588
for ( var i = 0 ; i < haystack . length ; i ++ ) {
580
589
var hay = haystack [ i ] ;
581
590
for ( var j = 0 ; j < needleSet . length ; j ++ ) {
0 commit comments