Skip to content

Commit 54dd1fa

Browse files
author
Travis CI
committed
Deploy 1cfa750 to NPM branch
1 parent 48970bf commit 54dd1fa

File tree

3 files changed

+25
-49
lines changed

3 files changed

+25
-49
lines changed

dist/immutable.es.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4282,19 +4282,7 @@ var Set = (function (SetCollection$$1) {
42824282
Set.prototype.map = function map (mapper, context) {
42834283
var this$1 = this;
42844284

4285-
var removes = [];
4286-
var adds = [];
4287-
this.forEach(function (value) {
4288-
var mapped = mapper.call(context, value, value, this$1);
4289-
if (mapped !== value) {
4290-
removes.push(value);
4291-
adds.push(mapped);
4292-
}
4293-
});
4294-
return this.withMutations(function (set) {
4295-
removes.forEach(function (value) { return set.remove(value); });
4296-
adds.forEach(function (value) { return set.add(value); });
4297-
});
4285+
return updateSet(this, this._map.map(function (v) { return mapper(v, v, this$1); }, context));
42984286
};
42994287

43004288
Set.prototype.union = function union () {

dist/immutable.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4288,19 +4288,7 @@
42884288
Set.prototype.map = function map (mapper, context) {
42894289
var this$1 = this;
42904290

4291-
var removes = [];
4292-
var adds = [];
4293-
this.forEach(function (value) {
4294-
var mapped = mapper.call(context, value, value, this$1);
4295-
if (mapped !== value) {
4296-
removes.push(value);
4297-
adds.push(mapped);
4298-
}
4299-
});
4300-
return this.withMutations(function (set) {
4301-
removes.forEach(function (value) { return set.remove(value); });
4302-
adds.forEach(function (value) { return set.add(value); });
4303-
});
4291+
return updateSet(this, this._map.map(function (v) { return mapper(v, v, this$1); }, context));
43044292
};
43054293

43064294
Set.prototype.union = function union () {

0 commit comments

Comments
 (0)