Skip to content

Commit

Permalink
Improve performance by only calling OpamStubs.getPathToSystem once
Browse files Browse the repository at this point in the history
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
  • Loading branch information
kit-ty-kate and dra27 committed Mar 4, 2024
1 parent c10789f commit 032e409
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ users)
* Ensure that the system critical error dialog is disabled when opam starts [#5828 @dra27]
* Fix loading git location at init [#5843 @rjbou]
* Remove use of deprecated function SHGetFolderPath and use SHGetKnownFolderPath instead [#5862 @kit-ty-kate]
* Improve performance by only calling OpamStubs.getPathToSystem once [#5862 @dra27]

## Test

Expand Down
5 changes: 3 additions & 2 deletions src/core/opamStd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,9 @@ module OpamSys = struct
Hashtbl.add memo arg r;
r

let system () =
OpamStubs.getPathToSystem ()
let system =
let system = Lazy.from_fun OpamStubs.getPathToSystem in
fun () -> Lazy.force system

type os =
| Darwin
Expand Down

0 comments on commit 032e409

Please sign in to comment.