function stableUpdateTabDiscardsInfoTableImpl() {
    uiHandler.getTabDiscardsInfo().then((response) => {
      let newInfos = response.infos;
      let stableInfos = [];

      // Update existing infos in place, remove old ones, and append new ones.
      // This tries to keep the existing ordering stable so that clicking links
      // is minimally disruptive.
      for (let i = 0; i < infos.length; ++i) {
        let oldInfo = infos[i];
        let newInfo = null;
        for (let j = 0; j < newInfos.length; ++j) {
          if (newInfos[j].id == oldInfo.id) {
            newInfo = newInfos[j];
            break;
          }
        }

        // Old infos that have corresponding new infos are pushed first, in the
        // current order of the old infos.
        if (newInfo != null)
          stableInfos.push(newInfo);
      }

      // Make sure info about new tabs is appended to the end, in the order they
      // were originally returned.
      for (let i = 0; i < newInfos.length; ++i) {
        let newInfo = newInfos[i];
        let oldInfo = null;
        for (let j = 0; j < infos.length; ++j) {
          if (infos[j].id == newInfo.id) {
            oldInfo = infos[j];
            break;
          }
        }

        // Entirely new information (has no corresponding old info) is appended
        // to the end.
        if (oldInfo == null)
          stableInfos.push(newInfo);
      }

      // Swap out the current info with the new stably sorted information.
      infos = stableInfos;

      // Render the content in place.
      renderTabDiscardsInfoTable();
    });
  }
/**
   * Causes the discard info table to be updated in as stable a manner as
   * possible. That is, rows will stay in their relative positions, even if the
   * current sort order is violated. Only the addition or removal of rows (tabs)
   * can cause the layout to change.
   */
Causes the discard info table to be updated in as stable a manner as
possible. That is, rows will stay in their relative positions, even if the
current sort order is violated. Only the addition or removal of rows (tabs)
can cause the layout to change.
Causes the discard info table to be updated in as stable a manner as possible . That is rows will stay in their relative positions even if the current sort order is violated . Only the addition or removal of rows ( tabs ) can cause the layout to change .
function stableUpdateTabDiscardsInfoTableImpl() {
    uiHandler.getTabDiscardsInfo().then((response) => {
      let newInfos = response.infos;
      let stableInfos = [];
      for (let i = 0; i < infos.length; ++i) {
        let oldInfo = infos[i];
        let newInfo = null;
        for (let j = 0; j < newInfos.length; ++j) {
          if (newInfos[j].id == oldInfo.id) {
            newInfo = newInfos[j];
            break;
          }
        }
        if (newInfo != null)
          stableInfos.push(newInfo);
      }
      for (let i = 0; i < newInfos.length; ++i) {
        let newInfo = newInfos[i];
        let oldInfo = null;
        for (let j = 0; j < infos.length; ++j) {
          if (infos[j].id == newInfo.id) {
            oldInfo = infos[j];
            break;
          }
        }
        if (oldInfo == null)
          stableInfos.push(newInfo);
      }
      infos = stableInfos;
      renderTabDiscardsInfoTable();
    });
  }
function stableUpdateTabDiscardsInfoTableImpl ( ) { uiHandler . getTabDiscardsInfo ( ) . then ( ( response ) => { let newInfos = response . infos ; let stableInfos = [ ] ; for ( let i = 0 ; i < infos . length ; ++ i ) { let oldInfo = infos [ i ] ; let newInfo = null ; for ( let j = 0 ; j < newInfos . length ; ++ j ) { if ( newInfos [ j ] . id == oldInfo . id ) { newInfo = newInfos [ j ] ; break ; } } if ( newInfo != null ) stableInfos . push ( newInfo ) ; } for ( let i = 0 ; i < newInfos . length ; ++ i ) { let newInfo = newInfos [ i ] ; let oldInfo = null ; for ( let j = 0 ; j < infos . length ; ++ j ) { if ( infos [ j ] . id == newInfo . id ) { oldInfo = infos [ j ] ; break ; } } if ( oldInfo == null ) stableInfos . push ( newInfo ) ; } infos = stableInfos ; renderTabDiscardsInfoTable ( ) ; } ) ; }
Causes the discard info table to be updated in as stable a manner as
 possible.
Causes the discard info table to be updated in as stable a manner as possible .
// Update existing infos in place, remove old ones, and append new ones. // This tries to keep the existing ordering stable so that clicking links // is minimally disruptive. // Old infos that have corresponding new infos are pushed first, in the // current order of the old infos. // Make sure info about new tabs is appended to the end, in the order they // were originally returned. // Entirely new information (has no corresponding old info) is appended // to the end. // Swap out the current info with the new stably sorted information. // Render the content in place.