@@ -4,9 +4,7 @@ import {deepL, deepR, CachedMeasure, Split} from '../../0-core/index.js';
44import { One , Two , Three , Four } from '../../1-digit/index.js' ;
55import Lazy from '../../4-lazy/Lazy.js' ;
66import _prepend_small_list from '../../0-core/_fast/_prepend_small_list.js' ;
7- import _fill_right from '../../0-core/_fast/_fill_right.js' ;
87import isSameMeasure from '../../_debug/isSameMeasure.js' ;
9- import _append_small_list from '../../0-core/_fast/_append_small_list.js' ;
108import _from_by_filling from '../../0-core/_fast/_from_by_filling.js' ;
119import empty from '../../5-api/empty.js' ;
1210import delayApp3RecurseStep from '../../4-lazy/delayApp3RecurseStep.js' ;
@@ -92,25 +90,7 @@ Deep.prototype.prepend = function (iterable) {
9290} ;
9391
9492Deep . prototype . append = function ( iterable ) {
95- const it = iterable [ Symbol . iterator ] ( ) ;
96-
97- let event = it . next ( ) ;
98- if ( event . done ) return this ;
99- const a = event . value ;
100-
101- event = it . next ( ) ;
102- if ( event . done ) return this . push ( a ) ;
103- const b = event . value ;
104-
105- // TODO simplify
106- const middle = _append_small_list (
107- this . _middle ,
108- this . _right . _nodes ( this . M , new One ( a ) ) ,
109- ) . _copy_spine ( ) ;
110- // TODO _copy_spine should return a MutableDeep type on the spine
111- // TODO then _fill_right should only accept Empty, Single, or MutableDeep
112-
113- return _fill_right ( this . M , this . _left , middle , b , it ) ;
93+ return this . concat ( _from_by_filling ( this . M , iterable ) ) ;
11494} ;
11595
11696Deep . prototype . concat = function ( other ) {
0 commit comments