-
-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
Related: #732
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -351,10 +351,10 @@ export class UnitOfWork { | |
* clean up persist/remove stack from previous persist/remove calls for this entity done before flushing | ||
*/ | ||
private cleanUpStack(stack: AnyEntity[], entity: AnyEntity): void { | ||
for (const index in stack) { | ||
if (stack[index] === entity) { | ||
stack.splice(+index, 1); | ||
} | ||
const idx = stack.indexOf(entity); | ||
|
||
if (idx !== -1) { | ||
stack.splice(idx, 1); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
B4nan
Author
Member
|
||
} | ||
} | ||
|
||
|
Maybe
stack: Set<AnyEntity>()
yields better performance for your use-case. If it's a real 'stack' you should just callpop
.