Skip to content

Conversation

@D8H
Copy link
Collaborator

@D8H D8H commented Jan 20, 2026

No description provided.

@D8H D8H requested a review from 4ian as a code owner January 20, 2026 18:39
): Array<gdBaseEvent> => {
const filteredEvents: Array<gdBaseEvent> = [];
const allChildren = new Set<gdBaseEvent>();
// Children may come first because the selection is ordered by selection time.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if useful, but could you use contains:

/**
* Return true if the specified event exists in the list.
* \param event The event to searched for
* \param recursive Set it to false to prevent sub events to be inspected.
*/
bool Contains(const gd::BaseEvent& eventToSearch,
bool recursive = true) const;

(maybe not because you don't have an EventsList).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use a Set to avoid checking every selected items (S) with every children (C) of every selected items (S). Instead, I fill the set with every children (C) of every selected items (S). So, it's O(C * S) instead of O(C * S²)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants