Skip to content

Conversation

Ivorforce
Copy link
Member

@Ivorforce Ivorforce commented Jun 10, 2025

Same idea as above - we want to avoid accidentally converting to String, because it's expensive.

This also happens to fix another exact same type of bug as #107289, where Callable was accidentally converted to String before hashing, making using Callable as HashMap keys very slow. There is already a dedicated hash() function for Callable - it just wasn't used.

After this PR, there are just 4 implicit String conversions left:

  • Variant - probably can't fix this now, Variant has all the implicit conversions.
  • StringName - probably fine for now since it's usually fast (at least on repeated access).
  • NodePath - there's a lot of accessors, so it needs its own PR.
  • IPAddress - there's a lot of accessors, so it needs its own PR.

@akien-mga akien-mga modified the milestones: 4.x, 4.5 Jun 10, 2025
@Repiteo Repiteo merged commit cb6c7c6 into godotengine:master Jun 11, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jun 11, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants