Inefficient use of a for loop#10576
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
weizhouapache
left a comment
There was a problem hiding this comment.
code lgtm
not tested yet
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10576 +/- ##
=========================================
Coverage 16.26% 16.26%
Complexity 13388 13388
=========================================
Files 5674 5674
Lines 498929 498929
Branches 60338 60338
=========================================
+ Hits 81154 81158 +4
+ Misses 408736 408732 -4
Partials 9039 9039
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12806 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-12782)
|
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes HTTP header iteration by switching from headers.keySet() to headers.entrySet(), reducing lookups and improving efficiency.
- Replaces key-based iteration with entry-based iteration in
createUriRequest. - Ensures headers are set directly from entry key/value pairs.
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13609 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-13477)
|
Description
This PR improves how HTTP headers are set in the request. Replacing headers.keySet() with headers.entrySet().
This change enhances efficiency by directly accessing both the key and value in a single iteration, rather than fetching the key first and then looking up the value in the map.
Fixes: #10529
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?