Repository navigation
runtests: Added runnernums in order to have O(1) lookup - #22753
mihaigmarin wants to merge 4 commits into
Conversation
This pull request adds runnernums the reverse of runnerids. In this way the iteration over runnerids is no longer needed. The check can happen directly in runnernums. Signed-off-by: Mihai-Gabriel Marin <mihaigmarin@gmail.com>
There was a problem hiding this comment.
🟢 Approval recommended
Pull request overview
Adds a reverse runner-ID lookup to avoid repeated linear searches when resolving runner log directories.
Changes:
- Introduces
%runnernums. - Populates both runner lookup maps during initialization.
- Uses constant-time lookup in
getrunnerlogdir.
File summaries
| File | Description |
|---|---|
tests/runtests.pl |
Adds and uses the reverse runner lookup map. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Viktor Szakats <vszakats@users.noreply.github.com>
|
@vszakats Thank you for your review. I have applied the changes you suggested |
|
Thanks for the fixes @mihaigmarin. One more fix is necessary, CI reports mixed newlines: |
Signed-off-by: Mihai-Gabriel Marin <mihaigmarin@gmail.com>
|
No problem @vszakats, it is my pleasure. |
| my %singletest_logs; # log messages while in singletest array ref by runner | ||
| my $singletest_bufferedrunner; # runner ID which is buffering logs | ||
| my %runnerids; # runner IDs by number | ||
| my %runnernums; # runner numbers by IDs |
There was a problem hiding this comment.
Maybe add a comment to make it explicit that this is the same data as %runnerids, just inverted.
Co-authored-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Mihai-Gabriel Marin <mihaigmarin@gmail.com>
|
Thanks! |
|
My pleasure |
This pull request adds runnernums the reverse of runnerids.
In this way the iteration over runnerids is no longer needed.
The check can happen directly in runnernums.