godot icon indicating copy to clipboard operation
godot copied to clipboard

Replace `find` with `contains/has` where applicable

Open AThousandShips opened this issue 1 year ago • 2 comments

  • Replaces find(...) != -1, find(...) > -1, find(...) >= 0 with contains for String
  • Replaces find(...) == -1, find(...) < 0 with !contains for String
  • Replaces find(...) != -1, find(...) > -1, find(...) >= 0 with has for containers
  • Replaces find(...) == -1, find(...) < 0 with !has for containers

Split into four commits for review to make it easier to compare each type, to check the replacements are appropriate

AThousandShips avatar May 06 '24 14:05 AThousandShips

Guess this line could be changed too (after https://github.com/godotengine/godot/commit/d8aa2c65a9f857e86d0c1fc1cc6b95b8ccf23099): https://github.com/godotengine/godot/blob/d8aa2c65a9f857e86d0c1fc1cc6b95b8ccf23099/editor/connections_dialog.cpp#L285

Chaosus avatar May 06 '24 18:05 Chaosus

That's findn that's different, that's covered here:

  • https://github.com/godotengine/godot/pull/91611

AThousandShips avatar May 06 '24 18:05 AThousandShips

Thanks!

akien-mga avatar May 08 '24 12:05 akien-mga

Thank you!

AThousandShips avatar May 08 '24 13:05 AThousandShips