Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Dec 26, 2024
1 parent 9966278 commit f035b77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Range } from "@cursorless/common";

export class RangeNode<T extends { range: Range }> {
children: RangeNode<T>[] = [];
export class RangeTreeNode<T extends { range: Range }> {
children: RangeTreeNode<T>[] = [];

constructor(private item: T) {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Range } from "@cursorless/common";
import { RangeNode } from "./RangeNode";
import { RangeTreeNode } from "./RangeTreeNode";

/**
* Creates a tree of ranges from a list of ranges. This improves containing lookup time.
Expand All @@ -8,12 +8,12 @@ import { RangeNode } from "./RangeNode";
*/
export function createRangeTree<T extends { range: Range }>(
items: T[],
): RangeNode<T>[] {
const results: RangeNode<T>[] = [];
const parents: RangeNode<T>[] = [];
): RangeTreeNode<T>[] {
const results: RangeTreeNode<T>[] = [];
const parents: RangeTreeNode<T>[] = [];

for (const item of items) {
const node = new RangeNode(item);
const node = new RangeTreeNode(item);

while (
parents.length > 0 &&
Expand Down

0 comments on commit f035b77

Please sign in to comment.