From 37758a01761331f534768a95f1948637cb7149c6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Apr 2021 10:40:37 +0200 Subject: Optimize getenv() for const char* name --- libbutl/utility.mxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libbutl/utility.mxx') 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 - getenv (const std::string&); + getenv (const char*); + + inline optional + 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. -- cgit v1.1