Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same function duplicted #111

Closed
uplift opened this issue Oct 21, 2021 · 2 comments
Closed

Same function duplicted #111

uplift opened this issue Oct 21, 2021 · 2 comments

Comments

@uplift
Copy link
Contributor

uplift commented Oct 21, 2021

Unless my eyes deceive me these two function are duplicated

SocketPlugins.sessionSharing.showUserIds = async (socket, data) => {
// Retrieve the hash and find matches
const { uids } = data;
if (!uids.length) {
throw new Error('no-uids-supplied');
}
return Promise.all(uids.map(async uid => db.getSortedSetRangeByScore(plugin.settings.name + ':uid', 0, -1, uid, uid)));
};
SocketPlugins.sessionSharing.showUserIds = async (socket, data) => {
// Retrieve the hash and find matches
const { uids } = data;
if (!uids.length) {
throw new Error('no-uids-supplied');
}
return Promise.all(uids.map(async uid => db.getSortedSetRangeByScore(plugin.settings.name + ':uid', 0, -1, uid, uid)));
};

@julianlam
Copy link
Owner

You're making me look bad 😃

@uplift
Copy link
Contributor Author

uplift commented Oct 22, 2021

You and me both. One of the team found it after I had already gone through the code and missed it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants