From 3fbeb33390c80af668f2b6fb33fdfa7040578520 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 8 Aug 2020 12:17:20 -0400 Subject: [PATCH] Update CONTRIBUTING.md --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c79ce649fc..fe38a3a925 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,20 +40,20 @@ In general, if you are using IntelliJ, you should be warned about platform incom #### Use `arc` collections and classes when possible. -Instead of using `java.util.List`, `java.util.HashMap`, and other standard Java collections, use `Array`, `ObjectMap` and other equivalents from `arc.struct`. +Instead of using `java.util.List`, `java.util.HashMap`, and other standard Java collections, use `Seq`, `ObjectMap` and other equivalents from `arc.struct`. 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` +- `List` / `ArrayList` / `Stack` -> `Seq` - `java.util.Queue` -> `arc.struct.Queue` - *Many others* #### Avoid boxed types (Integer, Boolean) -Never create variables or collections with boxed types `Array` or `ObjectMap`. Use the collections specialized for this task, e.g. `IntArray` and `IntMap`. +Never create variables or collections with boxed types `Seq` or `ObjectMap`. Use the collections specialized for this task, e.g. `IntSeq` and `IntMap`. #### Do not allocate anything if possible.