Skip to content

Commit 6574208

Browse files
committed
refactor: use dictonary iterator to avoid lookup during getEnvironment
1 parent 072cd44 commit 6574208

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Hummingbird/Environment.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ public struct Environment: Sendable, Decodable, ExpressibleByDictionaryLiteral {
112112
/// Construct environment variable map
113113
static func getEnvironment() -> [String: String] {
114114
var values: [String: String] = [:]
115-
for key in ProcessInfo.processInfo.environment.keys {
116-
values[key.lowercased()] = ProcessInfo.processInfo.environment[key]
115+
for item in ProcessInfo.processInfo.environment {
116+
values[item.key.lowercased()] = item.value
117117
}
118118
return values
119119
}

0 commit comments

Comments
 (0)