mol_jsx_lib 0.0.1144 → 0.0.1146

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.mjs CHANGED
@@ -492,9 +492,8 @@ var $;
492
492
  if (sub_pos !== end) {
493
493
  this.peer_move(end, sub_pos);
494
494
  }
495
- this.data.pop();
496
- this.data.pop();
497
- if (this.data.length === this.sub_from)
495
+ this.data.length = end;
496
+ if (end === this.sub_from)
498
497
  this.reap();
499
498
  }
500
499
  reap() { }
@@ -740,9 +739,8 @@ var $;
740
739
  const sub = this.data[cursor];
741
740
  const pos = this.data[cursor + 1];
742
741
  sub.pub_off(pos);
743
- this.data.pop();
744
- this.data.pop();
745
742
  }
743
+ this.sub_from = this.pub_from;
746
744
  this.cursor = this.pub_from;
747
745
  this.track_cut();
748
746
  this.cursor = $mol_wire_cursor.final;
@@ -751,23 +749,15 @@ var $;
751
749
  if (this.cursor < this.pub_from) {
752
750
  $mol_fail(new Error('Cut of non begun sub'));
753
751
  }
754
- let tail = 0;
752
+ let end = this.data.length;
755
753
  for (let cursor = this.cursor; cursor < this.sub_from; cursor += 2) {
756
754
  const pub = this.data[cursor];
757
755
  pub?.sub_off(this.data[cursor + 1]);
758
- if (this.sub_from < this.data.length) {
759
- this.peer_move(this.data.length - 2, cursor);
760
- this.data.pop();
761
- this.data.pop();
762
- }
763
- else {
764
- ++tail;
765
- }
766
- }
767
- for (; tail; --tail) {
768
- this.data.pop();
769
- this.data.pop();
756
+ end -= 2;
757
+ if (this.sub_from < end)
758
+ this.peer_move(end, cursor);
770
759
  }
760
+ this.data.length = end;
771
761
  this.sub_from = this.cursor;
772
762
  }
773
763
  complete() { }