Skip to content
Snippets Groups Projects
Commit 008c7822 authored by Adrien Béraud's avatar Adrien Béraud Committed by Sébastien Blin
Browse files

clang-tidy: fix issues

Change-Id: I2e7154624ad712b97dfdc2942ab0e924c8c8c306
parent adafd963
No related branches found
No related tags found
No related merge requests found
......@@ -108,13 +108,11 @@ class AccountFactory {
std::lock_guard<std::recursive_mutex> lock(mutex_);
std::vector<std::shared_ptr<T> > v;
const auto map = getMap_<T>();
if (map) {
if (const auto map = getMap_<T>()) {
v.reserve(map->size());
for (const auto& it : *map)
v.push_back(std::static_pointer_cast<T>(it.second));
}
v.shrink_to_fit();
return v;
}
......
......@@ -77,7 +77,7 @@ accountToJsonValue(const std::map<std::string, std::string>& details) {
// replace paths by the files content
std::ifstream ifs(i.second);
std::string fileContent((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
root[i.first] = fileContent;
root[i.first] = std::move(fileContent);
} else
root[i.first] = i.second;
}
......@@ -95,7 +95,7 @@ exportAccounts(const std::vector<std::string>& accountIDs,
return EINVAL;
}
std::size_t found = filepath.find_last_of(DIR_SEPARATOR_STR);
std::size_t found = filepath.find_last_of(DIR_SEPARATOR_CH);
auto toDir = filepath.substr(0,found);
auto filename = filepath.substr(found+1);
......
......@@ -51,7 +51,7 @@ namespace jami {
/// code \a errcode when the predicate return true.
/// The predicate should have <code>bool(Call*) signature</code>.
inline void
hangupCallsIf(Call::SubcallSet callptr_list, int errcode, const std::function<bool(Call*)>& pred)
hangupCallsIf(const Call::SubcallSet& callptr_list, int errcode, const std::function<bool(Call*)>& pred)
{
std::for_each(std::begin(callptr_list), std::end(callptr_list),
[&](const std::shared_ptr<Call>& call_ptr) {
......@@ -70,7 +70,7 @@ hangupCallsIf(Call::SubcallSet callptr_list, int errcode, const std::function<bo
///
/// Works as hangupCallsIf() with a predicate that always return true.
inline void
hangupCalls(Call::SubcallSet callptr_list, int errcode)
hangupCalls(const Call::SubcallSet& callptr_list, int errcode)
{
hangupCallsIf(callptr_list, errcode, [](Call*){ return true; });
}
......
......@@ -345,8 +345,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
mutable std::recursive_mutex callMutex_ {};
private:
friend void hangupCallsIf(Call::SubcallSet, int, const std::function<bool(Call*)>&);
bool validStateTransition(CallState newState);
void checkPendingIM();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment