Quellcode durchsuchen

Recommend avoiding the List datatype in C++ usage guidelines

(cherry picked from commit e82b433b6df45f4bf07ed000cc938ae4f2d0528b)
Hugo Locurcio vor 3 Jahren
Ursprung
Commit
327fb07ba1
1 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen
  1. 8 2
      community/contributing/cpp_usage_guidelines.rst

+ 8 - 2
community/contributing/cpp_usage_guidelines.rst

@@ -56,10 +56,16 @@ This means that pull requests should **not** use ``std::string``,
 ``std::vector`` and the like. Instead, use Godot's datatypes as described below:
 
 - Use ``String`` instead of ``std::string``.
-- Use ``Vector`` instead of ``std::vector``. In some cases, ``List`` or
-  ``LocalVector`` can be used as an alternative (ask core developers first).
+- Use ``Vector`` instead of ``std::vector``. In some cases, ``LocalVector``
+  can be used as an alternative (ask core developers first).
 - Use ``Array`` instead of ``std::array``.
 
+.. note::
+
+    Godot also has a List datatype (which is a linked list). While List is already used
+    in the codebase, it typically performs worse than other datatypes like Vector
+    and Array. Therefore, List should be avoided in new code unless necessary.
+
 ``auto`` keyword
 ^^^^^^^^^^^^^^^^