Skip to content

Commit

Permalink
Runnable identifier: optmize for the most common scenario
Browse files Browse the repository at this point in the history
The most common scenario is the runnable having its identifier format
after its URI.  When that's the case, there's no need to build the
arguments to the formatting string and performing the string format
itself.

Signed-off-by: Cleber Rosa <[email protected]>
  • Loading branch information
clebergnu committed Jun 26, 2024
1 parent 3d45f37 commit 3a73b30
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions avocado/core/nrunner/runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ def identifier(self):
"""
fmt = self.config.get("runner.identifier_format", "{uri}")

# For the cases where there is no config (when calling the Runnable
# directly
if not fmt:
# Optimize for the most common scenario
if fmt == "{uri}":
return self.uri

# For args we can use the entire list of arguments or with a specific
Expand Down

0 comments on commit 3a73b30

Please sign in to comment.