@@ -4,9 +4,7 @@ import {deepL, deepR, CachedMeasure, Split} from '../../0-core/index.js';
4
4
import { One , Two , Three , Four } from '../../1-digit/index.js' ;
5
5
import Lazy from '../../4-lazy/Lazy.js' ;
6
6
import _prepend_small_list from '../../0-core/_fast/_prepend_small_list.js' ;
7
- import _fill_right from '../../0-core/_fast/_fill_right.js' ;
8
7
import isSameMeasure from '../../_debug/isSameMeasure.js' ;
9
- import _append_small_list from '../../0-core/_fast/_append_small_list.js' ;
10
8
import _from_by_filling from '../../0-core/_fast/_from_by_filling.js' ;
11
9
import empty from '../../5-api/empty.js' ;
12
10
import delayApp3RecurseStep from '../../4-lazy/delayApp3RecurseStep.js' ;
@@ -92,25 +90,7 @@ Deep.prototype.prepend = function (iterable) {
92
90
} ;
93
91
94
92
Deep . 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 ) ) ;
114
94
} ;
115
95
116
96
Deep . prototype . concat = function ( other ) {
0 commit comments