summaryrefslogtreecommitdiff
path: root/src/file.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-01-24 20:41:19 +1100
committerMaxime Coste <mawww@kakoune.org>2019-01-24 21:21:59 +1100
commit4b72cfe530b682ad97f4d4815dcce7ca305bb7e6 (patch)
treec67b9e942623e1d2d54d32ab34ef94c7603da23b /src/file.cc
parent90dd084993b6a69f3a265b37077d90656f9bbb02 (diff)
Replace std::tie with structured bindings
Diffstat (limited to 'src/file.cc')
-rw-r--r--src/file.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/file.cc b/src/file.cc
index a71bdb55..ce6e00b5 100644
--- a/src/file.cc
+++ b/src/file.cc
@@ -320,8 +320,7 @@ void write_buffer_to_file(Buffer& buffer, StringView filename, bool force, bool
void write_buffer_to_backup_file(Buffer& buffer)
{
String path = real_path(buffer.name());
- StringView dir, file;
- std::tie(dir,file) = split_path(path);
+ auto [dir,file] = split_path(path);
char pattern[PATH_MAX];
if (dir.empty())
@@ -440,8 +439,7 @@ CandidateList complete_filename(StringView prefix, const Regex& ignored_regex,
ByteCount cursor_pos, FilenameFlags flags)
{
prefix = prefix.substr(0, cursor_pos);
- StringView dirname, fileprefix;
- std::tie(dirname, fileprefix) = split_path(prefix);
+ auto [dirname, fileprefix] = split_path(prefix);
auto parsed_dirname = parse_filename(dirname);
const bool check_ignored_regex = not ignored_regex.empty() and
@@ -469,8 +467,7 @@ CandidateList complete_filename(StringView prefix, const Regex& ignored_regex,
CandidateList complete_command(StringView prefix, ByteCount cursor_pos)
{
String real_prefix = parse_filename(prefix.substr(0, cursor_pos));
- StringView dirname, fileprefix;
- std::tie(dirname, fileprefix) = split_path(real_prefix);
+ auto [dirname, fileprefix] = split_path(real_prefix);
if (not dirname.empty())
{