Skip to content

Commit e155079

Browse files
authored
fix(AddUniqueOp): Remove unnessary object reference and comment (#1253)
Addresses: #443 Removing this to prevent confusion. Does anybody want to explain why this is needed?
1 parent c6bb7e2 commit e155079

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ParseOp.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,14 @@ export class AddUniqueOp extends Op {
199199
return this._value || [];
200200
}
201201
if (Array.isArray(value)) {
202-
// copying value lets Flow guarantee the pointer isn't modified elsewhere
203-
const valueCopy = value;
204202
const toAdd = [];
205203
this._value.forEach((v) => {
206204
if (v instanceof ParseObject) {
207-
if (!arrayContainsObject(valueCopy, v)) {
205+
if (!arrayContainsObject(value, v)) {
208206
toAdd.push(v);
209207
}
210208
} else {
211-
if (valueCopy.indexOf(v) < 0) {
209+
if (value.indexOf(v) < 0) {
212210
toAdd.push(v);
213211
}
214212
}

0 commit comments

Comments
 (0)