MCPcopy Create free account
hub / github.com/google/pprof / selectMatching

Function selectMatching

internal/driver/html/common.js:452–485  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

450 }
451
452 function selectMatching() {
453 searchAlarm = null;
454 let re = null;
455 if (search.value != '') {
456 try {
457 re = new RegExp(search.value);
458 } catch (e) {
459 // TODO: Display error state in search box
460 return;
461 }
462 }
463
464 function match(text) {
465 return re != null && re.test(text);
466 }
467
468 // drop currently selected items that do not match re.
469 selected.forEach(function(v, n) {
470 if (!match(nodes[n])) {
471 unselect(n);
472 }
473 })
474
475 // add matching items that are not currently selected.
476 if (nodes) {
477 for (let n = 0; n < nodes.length; n++) {
478 if (!selected.has(n) && match(nodes[n])) {
479 select(n);
480 }
481 }
482 }
483
484 updateButtons();
485 }
486
487 function toggleSvgSelect(elem) {
488 // Walk up to immediate child of graph0

Callers

nothing calls this directly

Calls 4

unselectFunction · 0.85
selectFunction · 0.85
updateButtonsFunction · 0.85
matchFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…