[Lldb-commits] [PATCH] D41359: Add Utility/Environment class for handling... environments

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 18 09:36:24 PST 2017


labath marked an inline comment as done.
labath added inline comments.


================
Comment at: include/lldb/Utility/Environment.h:70-72
+  std::pair<iterator, bool> insert(llvm::StringRef KeyEqValue) {
+    return insert(KeyEqValue.split('='));
+  }
----------------
zturner wrote:
> Why'd you decide to go with inserting an entire pre-formatted key value pair in the form `{key}={value}`, instead of having the function be `insert(StringRef Key, StringRef Value)`?
> 
The `insert(key, value)` form is still available (and used where appropriate). This is a convenience function because in a lot of the cases we only have the "KEY=VALUE" form handy (constructing from `char**envp`, reading the env over gdb-remote, ...), and I wanted to avoid having each user having to split this  manually. I wouldn't be opposed to calling this something other than `insert` if you think it's confusing, but I think the functionality per-se is quite useful.


https://reviews.llvm.org/D41359





More information about the lldb-commits mailing list