arrays.ts ×3

Frontier kind: Code frontier

unlabeled · c_9495aa7c15d2

388 tests · 5378 LOC · 28 files · introduces 0 tests · 12 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges12 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
833 ranges5378 lines · 28 files · Browse complete extent
All tests (intent)
388 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 12 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/common/arrays.ts 9 introduced LOC · 3 ranges

Open complete file

515 */
516 export function shuffle<T>(array: T[], _seed?: number): void {
517 > let rand: () => number; arrays.ts
518 >
519 > if (typeof _seed === 'number') {
520 let seed = _seed;
521 // Seeded random number generator in JS. Modified from:
525 return x - Math.floor(x);
526 };
527 > } else { arrays.ts
528 > rand = Math.random;
529 > }
530 >
531 > for (let i = array.length - 1; i > 0; i -= 1) {
532 const j = Math.floor(rand() * (i + 1));
533 const temp = array[i];
535 array[j] = temp;
536 }
537 > } arrays.ts
538
539 /**
src/vs/base/common/ternarySearchTree.ts 3 introduced LOC · 3 ranges

Open complete file

355 fill(values: readonly [K, V][]): void;
356 fill(values: readonly [K, V][] | V, keys?: readonly K[]): void {
357 > if (keys) { ternarySearchTree.ts
358 const arr = keys.slice(0);
359 shuffle(arr);
361 this.set(k, (<V>values));
362 }
363 > } else { ternarySearchTree.ts
364 const arr = (<[K, V][]>values).slice(0);
365 shuffle(arr);