mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-22 07:31:17 -03:00
Another fish var performance improvement
Make setting fish vars more efficient by avoiding creating a wcstring_list_t for the case where we're setting one value. For the case where we're passing a list of values swap it with the list in the var rather than copying it. This makes the benchmark in #4200 approximately 6% faster.
This commit is contained in:
@@ -284,8 +284,8 @@ static int my_env_path_setup(const wchar_t *cmd, const wchar_t *key, //!OCLINT(
|
||||
|
||||
/// Call env_set. If this is a path variable, e.g. PATH, validate the elements. On error, print a
|
||||
/// description of the problem to stderr.
|
||||
static int my_env_set(const wchar_t *cmd, const wchar_t *key, int scope,
|
||||
const wcstring_list_t &list, io_streams_t &streams) {
|
||||
static int my_env_set(const wchar_t *cmd, const wchar_t *key, int scope, wcstring_list_t &list,
|
||||
io_streams_t &streams) {
|
||||
int retval;
|
||||
|
||||
if (is_path_variable(key)) {
|
||||
|
||||
Reference in New Issue
Block a user