Skip to content

Commit 4a21293

Browse files
committed
utils: remove union
1 parent dcbdeea commit 4a21293

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

lib/client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ client.prototype.handleMessage = function handleMessage(message) {
206206
joinInterval = 300;
207207
}
208208
const joinQueue = new Queue(joinInterval);
209-
const joinChannels = _.union(this.opts.channels, this.channels);
209+
const joinChannels = [ ...new Set([ ...this.opts.channels, ...this.channels ]) ];
210210
this.channels = [];
211211

212212
for(let i = 0; i < joinChannels.length; i++) {

lib/utils.js

-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ const _ = module.exports = {
3030
// Value is an integer..
3131
isInteger: int => !isNaN(_.toNumber(int, 0)),
3232

33-
// Merge two arrays..
34-
union: (a, b) => [ ...new Set([ ...a, ...b ]) ],
35-
3633
// Value is a regex..
3734
isRegex: str => /[|\\^$*+?:#]/.test(str),
3835

0 commit comments

Comments
 (0)