diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-20 10:40:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-20 10:40:37 +0200 |
commit | 37758a01761331f534768a95f1948637cb7149c6 (patch) | |
tree | c4dae631954185a136426e227f316c71a51559d2 /libbutl/utility.mxx | |
parent | fe7ff3cedadc33655d6a27b9410515e4e6153c0e (diff) |
Optimize getenv() for const char* name
Diffstat (limited to 'libbutl/utility.mxx')
-rw-r--r-- | libbutl/utility.mxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libbutl/utility.mxx b/libbutl/utility.mxx index 6965be4..bd24ffd 100644 --- a/libbutl/utility.mxx +++ b/libbutl/utility.mxx @@ -322,7 +322,13 @@ LIBBUTL_MODEXPORT namespace butl // overrides (thread_env). // LIBBUTL_SYMEXPORT optional<std::string> - getenv (const std::string&); + getenv (const char*); + + inline optional<std::string> + getenv (const std::string& n) + { + return getenv (n.c_str ()); + } // Set the process environment variable. Best done before starting any // threads (see thread_env). Throw system_error on failure. |