Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 521e563

Browse files
committed
Additional fixes of clang-tidy's performance warnings
1 parent 31b6484 commit 521e563

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/filesystem.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ boost::filesystem::path filesystem::get_executable(const boost::filesystem::path
187187
return executable_name;
188188
}
189189

190-
auto executable_name_str = executable_name.string();
190+
auto &executable_name_str = executable_name.string();
191191
for(auto &path: bin_paths) {
192192
boost::filesystem::path executable;
193193
for(boost::filesystem::directory_iterator it(path), end; it != end; ++it) {

src/git.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ Git::Repository::Repository(const boost::filesystem::path &path) {
9898
{
9999
Error error;
100100
std::lock_guard<std::mutex> lock(mutex);
101-
auto path_str=path.generic_string();
102-
error.code = git_repository_open_ext(&repository_ptr, path_str.c_str(), 0, nullptr);
101+
error.code = git_repository_open_ext(&repository_ptr, path.generic_string().c_str(), 0, nullptr);
103102
if(error)
104103
throw std::runtime_error(error.message());
105104
}
@@ -229,8 +228,7 @@ boost::filesystem::path Git::Repository::get_root_path(const boost::filesystem::
229228
{
230229
Error error;
231230
std::lock_guard<std::mutex> lock(mutex);
232-
auto path_str=path.generic_string();
233-
error.code = git_repository_discover(&root, path_str.c_str(), 0, nullptr);
231+
error.code = git_repository_discover(&root, path.generic_string().c_str(), 0, nullptr);
234232
if(error)
235233
throw std::runtime_error(error.message());
236234
}

src/source_spellcheck.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ Source::SpellCheckView::SpellCheckView(const boost::filesystem::path &file_path,
6666
if(!iter.starts_line() && !iter.ends_line() && is_word_iter(iter) &&
6767
previous_iter.backward_char() && !previous_iter.starts_line() && !is_word_iter(previous_iter)) {
6868
auto first=previous_iter;
69-
auto second=iter;
7069
if(first.backward_char()) {
71-
get_buffer()->remove_tag(spellcheck_error_tag, first, second);
70+
get_buffer()->remove_tag(spellcheck_error_tag, first, iter);
7271
auto word=get_word(first);
7372
spellcheck_word(word.first, word.second);
74-
word=get_word(second);
73+
word=get_word(iter);
7574
spellcheck_word(word.first, word.second);
7675
}
7776
}

0 commit comments

Comments
 (0)