use the collection directly (#10917)

getComputers() calls getComputerCollection() before using streams to sort the entries, to put the results into an array, all just to get the number of computers.
just use the collection directly and call size() to avoid the overhead.
This commit is contained in:
James Nord 2025-08-07 20:22:27 +01:00 committed by GitHub
parent d205e10bd6
commit 0a1261de8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -251,7 +251,7 @@ public class NodeProvisioner {
LOGGER.log(Level.INFO,
"{0} provisioning successfully completed. "
+ "We have now {1,number,integer} computer(s)",
new Object[]{f.displayName, jenkins.getComputers().length});
new Object[]{f.displayName, jenkins.getComputersCollection().size()});
fireOnCommit(f, node);
} catch (IOException e) {
LOGGER.log(Level.WARNING,