Merged PR 212: Optimize FindChildrenById from O(n) to O(1)
Optimize FindChildrenById from O(n) to O(1): - Deprecate FindContainerByIdDFS - Container: Replace Children to string[] - Add HashMap to IHistoryState that contains all containers To access a container by id now cost O(1) without any additional cost + Implement CICD for SVGLibs
This commit is contained in:
parent
466ef2b08b
commit
c256a76e01
45 changed files with 775 additions and 450 deletions
|
@ -1,7 +1,7 @@
|
|||
import React, { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react';
|
||||
import { events as EVENTS } from '../../Events/AppEvents';
|
||||
import { MainMenu } from '../MainMenu/MainMenu';
|
||||
import { ContainerModel } from '../../Interfaces/IContainerModel';
|
||||
import { ContainerModel, IContainerModel } from '../../Interfaces/IContainerModel';
|
||||
import { Editor } from '../Editor/Editor';
|
||||
import { IEditorState } from '../../Interfaces/IEditorState';
|
||||
import { LoadState } from './Actions/Load';
|
||||
|
@ -81,12 +81,15 @@ export function App(props: IAppProps): JSX.Element {
|
|||
null,
|
||||
DEFAULT_MAINCONTAINER_PROPS
|
||||
);
|
||||
const containers = new Map<string, IContainerModel>();
|
||||
containers.set(defaultMainContainer.properties.id, defaultMainContainer);
|
||||
|
||||
const [editorState, setEditorState] = useState<IEditorState>({
|
||||
configuration: DEFAULT_CONFIG,
|
||||
history: [{
|
||||
lastAction: '',
|
||||
mainContainer: defaultMainContainer,
|
||||
mainContainer: defaultMainContainer.properties.id,
|
||||
containers,
|
||||
selectedContainerId: defaultMainContainer.properties.id,
|
||||
typeCounters: {},
|
||||
symbols: new Map(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue