lib/diff.js
function makeKeyIndexAndFree (list, key) {
  var keyIndex = {}
  var free = []
  for (var i = 0, len = list.length; i < len; i++) {
    var item = list[i]
    var itemKey = getItemKey(item, key)
    if (itemKey) {
      keyIndex[itemKey] = i
    } else {
      free.push(item)
    }
  }
  return {
    keyIndex: keyIndex,
    free: free
  }
}
function makeKeyIndexAndFree (list, key) {
  var keyIndex = {}
  var free = []
  for (var i = 0, len = list.length; i < len; i++) {
    var item = list[i]
    var itemKey = getItemKey(item, key)
    if (itemKey) {
      keyIndex[itemKey] = i
    } else {
      free.push(item)
    }
  }
  return {
    keyIndex: keyIndex,
    free: free
  }
}
function makeKeyIndexAndFree ( list , key ) { var keyIndex = { } var free = [ ] for ( var i = 0 , len = list . length ; i < len ; i ++ ) { var item = list [ i ] var itemKey = getItemKey ( item , key ) if ( itemKey ) { keyIndex [ itemKey ] = i } else { free . push ( item ) } } return { keyIndex : keyIndex , free : free } }
Convert list to key-item keyIndex object.
@param {Array} list
@param {String|Function} key
Convert list to key - item keyIndex object .