@@ -265,6 +265,7 @@ function _getEdge(a, b, prop, fn) {
265265}
266266
267267function _segments ( line , target , property ) {
268+ const segments = line . segments ;
268269 const points = line . points ;
269270 const tpoints = target . points ;
270271 const parts = [ ] ;
@@ -280,7 +281,8 @@ function _segments(line, target, property) {
280281 }
281282 }
282283
283- for ( const segment of line . segments ) {
284+ for ( let i = 0 ; i < segments . length ; i ++ ) {
285+ const segment = segments [ i ] ;
284286 const bounds = getBounds ( property , points [ segment . start ] , points [ segment . end ] , segment . loop ) ;
285287
286288 if ( ! target . segments ) {
@@ -298,13 +300,14 @@ function _segments(line, target, property) {
298300 // Get all segments from `target` that intersect the bounds of current segment of `line`
299301 const subs = _boundSegments ( target , bounds ) ;
300302
301- for ( const sub of subs ) {
303+ for ( let j = 0 ; j < subs . length ; ++ j ) {
304+ const sub = subs [ j ] ;
302305 const subBounds = getBounds ( property , tpoints [ sub . start ] , tpoints [ sub . end ] , sub . loop ) ;
303306 const fillSources = _boundSegment ( segment , points , subBounds ) ;
304307
305- for ( const source of fillSources ) {
308+ for ( let k = 0 ; k < fillSources . length ; k ++ ) {
306309 parts . push ( {
307- source,
310+ source : fillSources [ k ] ,
308311 target : sub ,
309312 start : {
310313 [ property ] : _getEdge ( bounds , subBounds , 'start' , Math . max )
0 commit comments