Skip to content

Commit

Permalink
perf(invokeazurerequest): ⚡ removed string concatenation
Browse files Browse the repository at this point in the history
Much faster and far less memory usage through sending objects down the 
pipeline rather than concatting.
  • Loading branch information
prubis committed Dec 19, 2023
1 parent 4833e0e commit 5e8aefc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/private/Invoke-AzureRequest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ function Invoke-AzureRequest {
$uri
)
$reply = Invoke-RetryRequest -Method Get -Uri $uri
$content = $reply.value
$reply.value
while (-not [String]::IsNullOrEmpty($reply.'@odata.nextLink')) {
Write-Verbose "Found next link: $($reply.'@odata.nextLink')"
$reply = Invoke-RetryRequest -Method Get -Uri $reply.'@odata.nextLink'
foreach ($value in $reply.value) {
$content += $value
$value
}
}
return $content
Expand Down

0 comments on commit 5e8aefc

Please sign in to comment.