Skip to content

Commit 70bee5c

Browse files
🩹 fix(Deep#append): Make it work.
1 parent f80b4fe commit 70bee5c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/3-tree/implementations/2-Deep.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {One, Two, Four} from '../../1-digit/index.js';
1212
import {delay, Lazy} from '../../4-lazy/index.js';
1313
import _prepend_small_list from '../../0-core/_fast/_prepend_small_list.js';
1414
import _fill_right from '../../0-core/_fast/_fill_right.js';
15+
import _append_small_list from '../../0-core/_fast/_append_small_list.js';
1516
import {Empty} from './index.js';
1617

1718
export function Deep(M, left, middle, right) {
@@ -121,7 +122,11 @@ Deep.prototype.append = function (iterable) {
121122
if (event.done) return this.push(a);
122123
const b = event.value;
123124

124-
const middle = this.middle.push(this.right._nodes(this.M, new One(a)));
125+
// TODO simplify
126+
const middle = _append_small_list(
127+
this.middle,
128+
this.right._nodes(this.M, new One(a)),
129+
);
125130

126131
return _fill_right(this.M, this.left, middle, b, it);
127132
};

0 commit comments

Comments
 (0)