diff --git a/src/filesystem.cc b/src/filesystem.cc index d8b8505..98df6a8 100644 --- a/src/filesystem.cc +++ b/src/filesystem.cc @@ -187,7 +187,7 @@ boost::filesystem::path filesystem::get_executable(const boost::filesystem::path return executable_name; } - auto executable_name_str = executable_name.string(); + auto &executable_name_str = executable_name.string(); for(auto &path: bin_paths) { boost::filesystem::path executable; for(boost::filesystem::directory_iterator it(path), end; it != end; ++it) { diff --git a/src/git.cc b/src/git.cc index dfadb89..99d2174 100644 --- a/src/git.cc +++ b/src/git.cc @@ -98,8 +98,7 @@ Git::Repository::Repository(const boost::filesystem::path &path) { { Error error; std::lock_guard lock(mutex); - auto path_str=path.generic_string(); - error.code = git_repository_open_ext(&repository_ptr, path_str.c_str(), 0, nullptr); + error.code = git_repository_open_ext(&repository_ptr, path.generic_string().c_str(), 0, nullptr); if(error) throw std::runtime_error(error.message()); } @@ -229,8 +228,7 @@ boost::filesystem::path Git::Repository::get_root_path(const boost::filesystem:: { Error error; std::lock_guard lock(mutex); - auto path_str=path.generic_string(); - error.code = git_repository_discover(&root, path_str.c_str(), 0, nullptr); + error.code = git_repository_discover(&root, path.generic_string().c_str(), 0, nullptr); if(error) throw std::runtime_error(error.message()); } diff --git a/src/source_spellcheck.cc b/src/source_spellcheck.cc index 84a6886..fea7248 100644 --- a/src/source_spellcheck.cc +++ b/src/source_spellcheck.cc @@ -66,12 +66,11 @@ Source::SpellCheckView::SpellCheckView(const boost::filesystem::path &file_path, if(!iter.starts_line() && !iter.ends_line() && is_word_iter(iter) && previous_iter.backward_char() && !previous_iter.starts_line() && !is_word_iter(previous_iter)) { auto first=previous_iter; - auto second=iter; if(first.backward_char()) { - get_buffer()->remove_tag(spellcheck_error_tag, first, second); + get_buffer()->remove_tag(spellcheck_error_tag, first, iter); auto word=get_word(first); spellcheck_word(word.first, word.second); - word=get_word(second); + word=get_word(iter); spellcheck_word(word.first, word.second); } }