rm-bytes
Ben McCann 11 months ago
parent 0ed05cfcc0
commit 0f4c7e807c

@ -371,7 +371,7 @@ function reconcile_tracked_array(
if (is_controlled && a) { if (is_controlled && a) {
clear_text_content(dom); clear_text_content(dom);
} }
while (a > 0) { while (a) {
block = a_blocks[--a]; block = a_blocks[--a];
destroy_each_item_block(block, active_transitions, apply_transitions, is_controlled); destroy_each_item_block(block, active_transitions, apply_transitions, is_controlled);
} }
@ -387,7 +387,7 @@ function reconcile_tracked_array(
/** @type {Node} */ /** @type {Node} */
var hydrating_node = current_hydration_fragment[0]; var hydrating_node = current_hydration_fragment[0];
while (b > 0) { while (b) {
// Hydrate block // Hydrate block
idx = b_end - --b; idx = b_end - --b;
item = array[idx]; item = array[idx];
@ -406,7 +406,7 @@ function reconcile_tracked_array(
} }
} else if (!a) { } else if (!a) {
// Create new blocks // Create new blocks
while (b > 0) { while (b) {
idx = b_end - --b; idx = b_end - --b;
item = array[idx]; item = array[idx];
key = is_computed_key ? keys[idx] : item; key = is_computed_key ? keys[idx] : item;
@ -502,7 +502,7 @@ function reconcile_tracked_array(
var should_create; var should_create;
if (is_animated) { if (is_animated) {
var i = b_length; var i = b_length;
while (i-- > 0) { while (i--) {
b_end = i + start; b_end = i + start;
a = sources[i]; a = sources[i];
if (pos === MOVED_BLOCK) { if (pos === MOVED_BLOCK) {
@ -514,7 +514,7 @@ function reconcile_tracked_array(
} }
var last_block; var last_block;
var last_sibling; var last_sibling;
while (b_length-- > 0) { while (b_length--) {
b_end = b_length + start; b_end = b_length + start;
a = sources[b_length]; a = sources[b_length];
should_create = a === -1; should_create = a === -1;
@ -597,7 +597,7 @@ function mark_lis(a) {
} }
if (k < a[index[lo]]) { if (k < a[index[lo]]) {
if (lo > 0) { if (lo) {
parent[i] = index[lo - 1]; parent[i] = index[lo - 1];
} }
index[lo] = i; index[lo] = i;
@ -657,7 +657,7 @@ function get_first_child(block) {
function destroy_active_transition_blocks(active_transitions) { function destroy_active_transition_blocks(active_transitions) {
var length = active_transitions.length; var length = active_transitions.length;
if (length > 0) { if (length) {
var i = 0; var i = 0;
var block; var block;
var transition; var transition;

@ -371,7 +371,7 @@ function execute_signal_fn(signal) {
} }
} }
if (dependencies && current_dependencies_index > 0) { if (dependencies && current_dependencies_index) {
dependencies.length = current_dependencies_index + current_dependencies.length; dependencies.length = current_dependencies_index + current_dependencies.length;
for (i = 0; i < current_dependencies.length; i++) { for (i = 0; i < current_dependencies.length; i++) {
dependencies[current_dependencies_index + i] = current_dependencies[i]; dependencies[current_dependencies_index + i] = current_dependencies[i];
@ -520,7 +520,7 @@ export function execute_effect(signal) {
if ( if (
is_runes(component_context) && // Don't rerun pre effects more than once to accomodate for "$: only runs once" behavior is_runes(component_context) && // Don't rerun pre effects more than once to accomodate for "$: only runs once" behavior
signal.f & PRE_EFFECT && signal.f & PRE_EFFECT &&
current_queued_pre_and_render_effects.length > 0 current_queued_pre_and_render_effects.length
) { ) {
flush_local_pre_effects(component_context); flush_local_pre_effects(component_context);
} }
@ -545,7 +545,7 @@ function infinite_loop_guard() {
*/ */
function flush_queued_effects(effects) { function flush_queued_effects(effects) {
const length = effects.length; const length = effects.length;
if (length > 0) { if (length) {
infinite_loop_guard(); infinite_loop_guard();
let i; let i;
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
@ -566,7 +566,7 @@ function flush_queued_effects(effects) {
function process_microtask() { function process_microtask() {
is_micro_task_queued = false; is_micro_task_queued = false;
if (current_queued_microtasks.length > 0) { if (current_queued_microtasks.length) {
const tasks = current_queued_microtasks.slice(); const tasks = current_queued_microtasks.slice();
current_queued_microtasks = []; current_queued_microtasks = [];
run_all(tasks); run_all(tasks);
@ -698,7 +698,7 @@ export function flushSync(fn) {
if (fn) { if (fn) {
fn(); fn();
} }
if (current_queued_pre_and_render_effects.length > 0 || effects.length > 0) { if (current_queued_pre_and_render_effects.length || effects.length) {
flushSync(); flushSync();
} }
if (is_micro_task_queued) { if (is_micro_task_queued) {
@ -1551,7 +1551,7 @@ export function prop(props, key, flags, initial) {
get(inner_current_value); get(inner_current_value);
} }
if (arguments.length > 0) { if (arguments.length) {
if (mutation || (immutable ? value !== current : safe_not_equal(value, current))) { if (mutation || (immutable ? value !== current : safe_not_equal(value, current))) {
from_child = true; from_child = true;
set(inner_current_value, mutation ? current : value); set(inner_current_value, mutation ? current : value);

@ -569,7 +569,7 @@ export function trigger_transitions(transitions, target_direction, from) {
mark_subtree_inert(transition.e, true); mark_subtree_inert(transition.e, true);
} }
} }
if (outros.length > 0) { if (outros.length) {
// Defer the outros to a microtask // Defer the outros to a microtask
const e = managed_pre_effect(() => { const e = managed_pre_effect(() => {
destroy_signal(e); destroy_signal(e);

Loading…
Cancel
Save