mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-05 15:58:14 +07:00
Update CONTRIBUTING.md
This commit is contained in:
@ -43,6 +43,13 @@ Instead of using `java.util.List`, `java.util.HashMap`, and other standard Java
|
||||
Why? Because that's what the rest of the codebase uses, and the standard collections have a lot of cruft and usability issues associated with them.
|
||||
In the rare case that concurrency is required, you may use the standard Java classes for that purpose (e.g. `CopyOnWriteArrayList`).
|
||||
|
||||
What you'll usually need to change:
|
||||
- `HashSet` -> `ObjectSet`
|
||||
- `HashMap` -> `ObjectMap`
|
||||
- `List` / `ArrayList` / `Stack` -> `Array`
|
||||
- `java.util.Queue` -> `io.anuke.arc.collection.Queue`
|
||||
- *Many others*
|
||||
|
||||
|
||||
#### Avoid boxed types (Integer, Boolean)
|
||||
Never create variables or collections with boxed types `Array<Integer>` or `ObjectMap<Integer, ...>`. Use the collections specialized for this task, e.g. `IntArray` and `IntMap`.
|
||||
|
Reference in New Issue
Block a user