mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
reduce memory usage - avoid deep copy
This commit is contained in:
parent
a2d7f19418
commit
b7f45f7870
1 changed files with 2 additions and 4 deletions
|
|
@ -86,13 +86,11 @@ export class PackageManagerViewStateManager {
|
|||
}
|
||||
|
||||
public getState(): ViewState {
|
||||
// Create a deep copy to ensure React sees changes
|
||||
return JSON.parse(JSON.stringify(this.state))
|
||||
return { ...this.state }
|
||||
}
|
||||
|
||||
private notifyStateChange(): void {
|
||||
// Create a deep copy to ensure React sees changes
|
||||
const newState = JSON.parse(JSON.stringify(this.state))
|
||||
const newState = { ...this.state }
|
||||
|
||||
this.stateChangeHandlers.forEach((handler) => {
|
||||
handler(newState)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue