Skip to content

Conversation

@GoToLoop
Copy link
Owner

@GoToLoop GoToLoop commented Jul 9, 2016

Since ArrayList isn't safe like Vector, I'm also adding synchronized () at places where either of its structure's size() changes.
Those 6 methods are: add(), addDrawable(), remove(), removeDrawable(), clear() and clearDrawable().
Of course, all loops traversing this class still needs to be synchronized externally as well; either over get() or getDrawables().
Last word: This patch is just a standalone performant refactoring. It's not obligatory for ControllerGroup's previous patch.

Since __*ArrayList*__ isn't safe like __*Vector*__, I'm also adding `synchronized ()` at places where either of its structure's **size()** changes.
Those 6 methods are: **add()**, **addDrawable()**, **remove()**, **removeDrawable()**, **clear()** and **clearDrawable()**.
Of course, all loops traversing this class still needs to be synchronized externally as well; either over **get()** or **getDrawables()**.
Last word: This patch is just a standalone performant refactoring. It's not obligatory for __*ControllerGroup*__'s previous patch.
@GoToLoop GoToLoop merged commit 2a15aaa into patch-1 Jul 9, 2016
@GoToLoop GoToLoop deleted the ControllerList-patch-1 branch July 9, 2016 09:28
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.

2 participants