function _dedupe (subs) {
  const dedupeSubs = {}
  for (let i = 0; i < subs.length; i++) {
    const sub = subs[i]
    dedupeSubs[sub.topic] = sub
  }
  const ret = []
  for (const key in dedupeSubs) {
    ret.push(dedupeSubs[key])
  }
  return ret
}
// if same subscribed topic in subs array, we pick up the last one
if same subscribed topic in subs array, we pick up the last one
if same subscribed topic in subs array we pick up the last one
function _dedupe (subs) {
  const dedupeSubs = {}
  for (let i = 0; i < subs.length; i++) {
    const sub = subs[i]
    dedupeSubs[sub.topic] = sub
  }
  const ret = []
  for (const key in dedupeSubs) {
    ret.push(dedupeSubs[key])
  }
  return ret
}
function _dedupe ( subs ) { const dedupeSubs = { } for ( let i = 0 ; i < subs . length ; i ++ ) { const sub = subs [ i ] dedupeSubs [ sub . topic ] = sub } const ret = [ ] for ( const key in dedupeSubs ) { ret . push ( dedupeSubs [ key ] ) } return ret }
if same subscribed topic in subs array, we pick up the last one
if same subscribed topic in subs array we pick up the last one