File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ import POSIX
18
18
public final class Resources {
19
19
/// The registered path of the main executable.
20
20
private static var registeredMainExecutablePath : String ? = nil
21
- /// The computed paths for the install path and executable of package manager
22
- static var _computedResourcePaths : ( install: String , executable: String ? ) ?
23
-
21
+
24
22
/// Initialize the resources support.
25
23
///
26
24
/// This function should be called from the module defining the executable
@@ -91,12 +89,10 @@ public final class Resources {
91
89
return Path . join ( installPath, " lib " , " swift " , " pm " )
92
90
}
93
91
94
- private static var computedResourcePaths : ( install: String , executable: String ? ) {
95
- if _computedResourcePaths == nil {
96
- _computedResourcePaths = computeResourcesPaths ( )
97
- }
98
- return _computedResourcePaths!
99
- }
92
+ /// The computed paths for the install path and executable of package manager
93
+ private static var computedResourcePaths : ( install: String , executable: String ? ) = {
94
+ Resources . computeResourcesPaths ( )
95
+ } ( )
100
96
101
97
/// Compute the paths for resources.
102
98
private static func computeResourcesPaths( ) -> ( install: String , executable: String ? ) {
You can’t perform that action at this time.
0 commit comments