lib/command/set.js
function sdiff(key /* key-1, key-N, req*/) {
  var args = slice.call(arguments, 1)
    , req = typeof args[args.length - 1] === 'object' ? args.pop() : null
    , set = this.getKey(key, req)
    , list
    , src
    , j
    , i;

  if(!set) return [];

  list = set.data.slice(0);

  for(j = 0;j < list.length;j++) {
    for(i = 0;i < args.length;i++) {
      src = this.getKey(args[i], req);
      if(src === undefined) continue;
      if(src.sismember(list[j])) {
        list.splice(j, 1);
        j--;
        break;
      }
    }
  }

  return list;
}
function sdiff(key /* key-1, key-N, req*/) {
  var args = slice.call(arguments, 1)
    , req = typeof args[args.length - 1] === 'object' ? args.pop() : null
    , set = this.getKey(key, req)
    , list
    , src
    , j
    , i;

  if(!set) return [];

  list = set.data.slice(0);

  for(j = 0;j < list.length;j++) {
    for(i = 0;i < args.length;i++) {
      src = this.getKey(args[i], req);
      if(src === undefined) continue;
      if(src.sismember(list[j])) {
        list.splice(j, 1);
        j--;
        break;
      }
    }
  }

  return list;
}
function sdiff ( key /* key-1, key-N, req*/ ) { var args = slice . call ( arguments , 1 ) , req = typeof args [ args . length - 1 ] === 'object' ? args . pop ( ) : null , set = this . getKey ( key , req ) , list , src , j , i ; if ( ! set ) return [ ] ; list = set . data . slice ( 0 ) ; for ( j = 0 ; j < list . length ; j ++ ) { for ( i = 0 ; i < args . length ; i ++ ) { src = this . getKey ( args [ i ] , req ) ; if ( src === undefined ) continue ; if ( src . sismember ( list [ j ] ) ) { list . splice ( j , 1 ) ; j -- ; break ; } } } return list ; }
Returns the members of the set resulting from the difference
between the first set and successive sets.
Returns the members of the set resulting from the difference between the first set and successive sets .