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/node.js CHANGED
@@ -311,9 +311,8 @@ var $;
311
311
  if (sub_pos !== end) {
312
312
  this.peer_move(end, sub_pos);
313
313
  }
314
- this.data.pop();
315
- this.data.pop();
316
- if (this.data.length === this.sub_from)
314
+ this.data.length = end;
315
+ if (end === this.sub_from)
317
316
  this.reap();
318
317
  }
319
318
  reap() { }
@@ -545,9 +544,8 @@ var $;
545
544
  const sub = this.data[cursor];
546
545
  const pos = this.data[cursor + 1];
547
546
  sub.pub_off(pos);
548
- this.data.pop();
549
- this.data.pop();
550
547
  }
548
+ this.data.length = this.sub_from;
551
549
  this.cursor = this.pub_from;
552
550
  this.track_cut();
553
551
  this.cursor = $mol_wire_cursor.final;
@@ -556,23 +554,15 @@ var $;
556
554
  if (this.cursor < this.pub_from) {
557
555
  $mol_fail(new Error('Cut of non begun sub'));
558
556
  }
559
- let tail = 0;
557
+ let end = this.data.length;
560
558
  for (let cursor = this.cursor; cursor < this.sub_from; cursor += 2) {
561
559
  const pub = this.data[cursor];
562
560
  pub?.sub_off(this.data[cursor + 1]);
563
- if (this.sub_from < this.data.length) {
564
- this.peer_move(this.data.length - 2, cursor);
565
- this.data.pop();
566
- this.data.pop();
567
- }
568
- else {
569
- ++tail;
570
- }
571
- }
572
- for (; tail; --tail) {
573
- this.data.pop();
574
- this.data.pop();
561
+ end -= 2;
562
+ if (this.sub_from <= end)
563
+ this.peer_move(end, cursor);
575
564
  }
565
+ this.data.length = end;
576
566
  this.sub_from = this.cursor;
577
567
  }
578
568
  complete() { }