diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-09-03 13:21:35 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-09-03 13:21:35 +0100 |
| commit | e69db0f671a6f7cdbc10fe3e7099f0c2fc4aa211 (patch) | |
| tree | 16779c28897cac052494a6f668315de823bc9549 /src/shell_manager.hh | |
| parent | ea7f76f7f27bd5fd461224b15c3eea9c7ce350f3 (diff) | |
Regex are overkill for shell manager env vars, we just need exact match or prefix match
Diffstat (limited to 'src/shell_manager.hh')
| -rw-r--r-- | src/shell_manager.hh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shell_manager.hh b/src/shell_manager.hh index 586cf59b..d4fb23a1 100644 --- a/src/shell_manager.hh +++ b/src/shell_manager.hh @@ -33,11 +33,12 @@ public: ConstArrayView<String> params = {}, const EnvVarMap& env_vars = EnvVarMap{}); - void register_env_var(StringView regex, EnvVarRetriever retriever); + void register_env_var(StringView str, bool prefix, EnvVarRetriever retriever); String get_val(StringView name, const Context& context) const; private: - Vector<std::pair<Regex, EnvVarRetriever>> m_env_vars; + struct EnvVarDesc { String str; bool prefix; EnvVarRetriever func; }; + Vector<EnvVarDesc> m_env_vars; }; template<> struct WithBitOps<ShellManager::Flags> : std::true_type {}; |
