fix: exit loop as soon as command is found (#550)

This commit is contained in:
bolinfest
2022-03-23 23:22:57 -07:00
committed by GitHub
parent bda879fd22
commit 38e3eb264d

View File

@@ -98,7 +98,6 @@ func is_valid() -> bool:
# #
# *Returns* True if the command exists, else false. # *Returns* True if the command exists, else false.
func command_exists() -> bool: func command_exists() -> bool:
var command_found = false
for base_path in escoria.project_settings_manager.get_setting( for base_path in escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.COMMAND_DIRECTORIES escoria.project_settings_manager.COMMAND_DIRECTORIES
): ):
@@ -107,8 +106,8 @@ func command_exists() -> bool:
self.name self.name
] ]
if ResourceLoader.exists(command_path): if ResourceLoader.exists(command_path):
command_found = true return true
return command_found return false
# Run this command # Run this command