refactor
This commit is contained in:
parent
fd1ec1c853
commit
f1ca91faf1
@ -227,7 +227,7 @@ auto encrypt_provider::get_directory_items(const std::string &api_path,
|
||||
[this, &list](const encrypt_config &cfg,
|
||||
const std::string &source_path) -> api_error {
|
||||
try {
|
||||
for (auto &&dir_entry :
|
||||
for (const auto &dir_entry :
|
||||
utils::file::directory{source_path}.get_items()) {
|
||||
try {
|
||||
std::string current_api_path{};
|
||||
@ -388,7 +388,7 @@ auto encrypt_provider::get_file_list(api_file_list &list,
|
||||
const auto cfg = config_.get_encrypt_config();
|
||||
|
||||
try {
|
||||
for (auto &&dir_entry : utils::file::directory{cfg.path}.get_items()) {
|
||||
for (const auto &dir_entry : utils::file::directory{cfg.path}.get_items()) {
|
||||
std::string api_path{};
|
||||
if (process_directory_entry(*dir_entry.get(), cfg, api_path)) {
|
||||
list.emplace_back(create_api_file(
|
||||
@ -717,7 +717,7 @@ auto encrypt_provider::process_directory_entry(
|
||||
std::size_t current_idx{1U};
|
||||
std::string current_encrypted_path{};
|
||||
auto current_source_path{cfg.path};
|
||||
for (auto &&part : utils::path::get_parts(dir_path)) {
|
||||
for (const auto &part : utils::path::get_parts(dir_path)) {
|
||||
current_source_path = utils::path::combine(current_source_path, {part});
|
||||
|
||||
std::string current_api_path{};
|
||||
@ -965,7 +965,7 @@ void encrypt_provider::remove_deleted_files(const stop_type &stop_requested) {
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &&row : row_list) {
|
||||
for (const auto &row : row_list) {
|
||||
if (stop_requested) {
|
||||
return;
|
||||
}
|
||||
@ -986,7 +986,7 @@ void encrypt_provider::remove_deleted_files(const stop_type &stop_requested) {
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &&item : removed_list) {
|
||||
for (const auto &item : removed_list) {
|
||||
if (stop_requested) {
|
||||
return;
|
||||
}
|
||||
@ -1007,7 +1007,7 @@ void encrypt_provider::remove_deleted_files(const stop_type &stop_requested) {
|
||||
item.source_path);
|
||||
}
|
||||
|
||||
for (auto &&item : removed_list) {
|
||||
for (const auto &item : removed_list) {
|
||||
if (stop_requested) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user