Skip to content

Commit 90fe493

Browse files
make-github-pseudonymous-againAurélien Ooms
authored and
Aurélien Ooms
committed
♻️ refactor(delete_case1): Do not allow Leaf input.
1 parent 1da7e65 commit 90fe493

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/deletion/delete_case1.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import assert from 'assert';
22
import BLACK from '../color/BLACK.js';
33
import Node from '../types/Node.js';
4-
import Leaf from '../types/Leaf.js';
54
import delete_case2 from './delete_case2.js';
65

76
/**
@@ -10,10 +9,10 @@ import delete_case2 from './delete_case2.js';
109
* - all root-leaf paths going through n have a black height of b - 1
1110
* - all other root-leaf paths have a black height of b
1211
*
13-
* @param {Node|Leaf} n - The input node.
12+
* @param {Node} n - The input node.
1413
*/
1514
const delete_case1 = (n) => {
16-
assert(n instanceof Node || n instanceof Leaf);
15+
assert(n instanceof Node);
1716
assert(n._color === BLACK);
1817
// If n is the root, there is nothing to do:
1918
// - all paths go through n, and

0 commit comments

Comments
 (0)