mol_plot_all 1.2.1262 → 1.2.1264

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/web.js CHANGED
@@ -296,9 +296,8 @@ var $;
296
296
  if (sub_pos !== end) {
297
297
  this.peer_move(end, sub_pos);
298
298
  }
299
- this.data.pop();
300
- this.data.pop();
301
- if (this.data.length === this.sub_from)
299
+ this.data.length = end;
300
+ if (end === this.sub_from)
302
301
  this.reap();
303
302
  }
304
303
  reap() { }
@@ -530,9 +529,8 @@ var $;
530
529
  const sub = this.data[cursor];
531
530
  const pos = this.data[cursor + 1];
532
531
  sub.pub_off(pos);
533
- this.data.pop();
534
- this.data.pop();
535
532
  }
533
+ this.data.length = this.sub_from;
536
534
  this.cursor = this.pub_from;
537
535
  this.track_cut();
538
536
  this.cursor = $mol_wire_cursor.final;
@@ -541,23 +539,15 @@ var $;
541
539
  if (this.cursor < this.pub_from) {
542
540
  $mol_fail(new Error('Cut of non begun sub'));
543
541
  }
544
- let tail = 0;
542
+ let end = this.data.length;
545
543
  for (let cursor = this.cursor; cursor < this.sub_from; cursor += 2) {
546
544
  const pub = this.data[cursor];
547
545
  pub?.sub_off(this.data[cursor + 1]);
548
- if (this.sub_from < this.data.length) {
549
- this.peer_move(this.data.length - 2, cursor);
550
- this.data.pop();
551
- this.data.pop();
552
- }
553
- else {
554
- ++tail;
555
- }
556
- }
557
- for (; tail; --tail) {
558
- this.data.pop();
559
- this.data.pop();
546
+ end -= 2;
547
+ if (this.sub_from <= end)
548
+ this.peer_move(end, cursor);
560
549
  }
550
+ this.data.length = end;
561
551
  this.sub_from = this.cursor;
562
552
  }
563
553
  complete() { }