virtualx-engine/doc
David Briscoe 9cbc4026ee
doc: Clarify when to construct a StringName ahead of time
Fix docs don't give justification for manual construction.

Clarify how to apply manual StringName construction as an
optimization and that "string intern" means "work at parse time".

There are several godot-demo-projects (including 3d/platformer) that
incorrectly use StringName literals (they use & literals instead of just
passing strings), so clearly this is confusing.

AThousandShips did a disassembly test to prove it automatically converts
constant strings to StringName for annotated functions:

  func do_test(_var: StringName, _var2: String):
  pass

  func test():
  do_test("abc", "def")

Yields:

  Disassembling do_test(_var, _var2)
   0: line 2:     pass
   2: == END ==

  Disassembling test()
   0: line 5:     do_test("abc", "def")
   2: call self.do_test(const(&"abc"), const("def"))
   10: assign stack(3) = false
   12: == END ==

It also happens with built-in functions such as those of Input.
2024-02-09 12:08:12 +01:00
..
classes doc: Clarify when to construct a StringName ahead of time 2024-02-09 12:08:12 +01:00
tools Merge pull request #79406 from Calinou/docstatus-fix-version 2023-07-14 18:50:04 +02:00
translations i18n: Sync translations with Weblate 2023-07-05 16:04:29 +02:00
class.xsd Doctool: Remove version attribute from XML header 2023-07-06 10:08:21 +02:00
Doxyfile
Makefile