chore(utils/lightSet): minor improvement in clear method

This commit is contained in:
Julien Fontanet 2017-09-13 14:38:40 +02:00
parent 1037083ed2
commit 454412d9d4

View File

@ -293,7 +293,7 @@ export const parseXml = (function () {
// - works only with strings // - works only with strings
// - methods are already bound and chainable // - methods are already bound and chainable
export const lightSet = collection => { export const lightSet = collection => {
const data = createRawObject() let data = createRawObject()
if (collection) { if (collection) {
forEach(collection, value => { forEach(collection, value => {
data[value] = true data[value] = true
@ -307,9 +307,7 @@ export const lightSet = collection => {
return set return set
}, },
clear: () => { clear: () => {
for (const value in data) { data = createRawObject()
delete data[value]
}
return set return set
}, },
delete: value => { delete: value => {