<commit_before>import removeFragments from './removeFragments';
import removeFragment from './removeFragment';
import attachFragmentList from './attachFragmentList';
import attachFragment from './attachFragment';
import updateFragment from './updateFragment';
import moveFragment from './moveFragment';

export default function updateFragmentList( context, oldList, list, parentDom, component, outerNextFragment ) {
	let oldListLength = oldList.length;
	let listLength = list.length;

	if ( listLength === 0 ) {
		removeFragments( context, parentDom, oldList, 0, oldListLength );
		return;
	} else if ( oldListLength === 0 ) {
		attachFragmentList( context, list, parentDom, component );
		return;
	}

	let oldEndIndex = oldListLength - 1;
	let endIndex = listLength - 1;
	let oldStartIndex = 0, startIndex = 0;<commit_msg>updateFragmentList.js performance fix<commit_after>import removeFragments from './removeFragments';
import removeFragment from './removeFragment';
import attachFragmentList from './attachFragmentList';
import attachFragment from './attachFragment';
import updateFragment from './updateFragment';
import moveFragment from './moveFragment';

export default function updateFragmentList( context, oldList, list, parentDom, component, outerNextFragment ) {

    if (oldList === list) {
        return;
    }

	let oldListLength = oldList.length;
	let listLength = list.length;

	if ( listLength === 0 ) {
		removeFragments( context, parentDom, oldList, 0, oldListLength );
		return;
	} else if ( oldListLength === 0 ) {
		attachFragmentList( context, list, parentDom, component );
		return;
	}
	
	 if (oldListLength === 1 && listLength === 1) {
        updateFragment(context, oldList[0], list[0], parentDom);
    }

	let oldEndIndex = oldListLength - 1;
	let endIndex = listLength - 1;
	let oldStartIndex = 0, startIndex = 0;
{'fraction_non_alphanumeric': 0.11008676789587853, 'fraction_numerical': 0.009761388286334056, 'mean_word_length': 4.82018927444795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5204205', 'n_tokens_mistral': 540, 'n_tokens_neox': 506, 'n_words': 160}