Skip to content

Commit

Permalink
3850 – review fixes: removed unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
inoyakaigor committed Jul 2, 2024
1 parent 113558b commit 4acd882
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/mobx/src/types/observableset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ export class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillCh

intersection<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T & U> {
if (isES6Set(otherSet)) {
this.atom_.reportObserved()
return otherSet.intersection(this.data_)
return otherSet.intersection(this)
} else {
const dehancedSet = new Set(this)
return dehancedSet.intersection(otherSet)
Expand All @@ -255,8 +254,7 @@ export class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillCh

union<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T | U> {
if (isES6Set(otherSet)) {
this.atom_.reportObserved()
return otherSet.union(this.data_)
return otherSet.union(this)
} else {
const dehancedSet = new Set(this)
return dehancedSet.union(otherSet)
Expand All @@ -269,8 +267,7 @@ export class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillCh

symmetricDifference<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T | U> {
if (isES6Set(otherSet)) {
this.atom_.reportObserved()
return otherSet.symmetricDifference(this.data_)
return otherSet.symmetricDifference(this)
} else {
const dehancedSet = new Set(this)
return dehancedSet.symmetricDifference(otherSet)
Expand All @@ -287,8 +284,7 @@ export class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillCh

isDisjointFrom(otherSet: ReadonlySetLike<unknown> | Set<unknown>): boolean {
if (isES6Set(otherSet)) {
this.atom_.reportObserved()
return otherSet.isDisjointFrom(this.data_)
return otherSet.isDisjointFrom(this)
} else {
const dehancedSet = new Set(this)
return dehancedSet.isDisjointFrom(otherSet)
Expand Down

0 comments on commit 4acd882

Please sign in to comment.