Skip to content

Commit 91d9dc7

Browse files
Improve looping through environment variables
Co-authored-by: Olivier Halligon <[email protected]>
1 parent fcfdc67 commit 91d9dc7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Sources/libhostmgr/BuildkiteScriptBuilder.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ public struct BuildkiteScriptBuilder {
3535
prefixedBy prefix: String,
3636
from environment: [String: String] = ProcessInfo.processInfo.environment
3737
) {
38-
environment
39-
.filter { $0.key.starts(with: prefix) }
40-
.forEach { key, value in
41-
environmentVariables[key] = Value(wrapping: value)
42-
}
38+
for (key, value) in environment where key.starts(with: prefix) {
39+
environmentVariables[key] = Value(wrapping: value)
40+
}
4341
}
4442

4543
/// Add a line to the build script.

0 commit comments

Comments
 (0)