mirror of https://github.com/Icinga/icinga2.git
parent
602643b93d
commit
e8b0797ec4
|
@ -45,7 +45,7 @@ void ConfigType::RegisterObject(const ConfigObject::Ptr& object)
|
|||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
|
||||
ObjectMap::iterator it = m_ObjectMap.find(name);
|
||||
auto it = m_ObjectMap.find(name);
|
||||
|
||||
if (it != m_ObjectMap.end()) {
|
||||
if (it->second == object)
|
||||
|
|
|
@ -34,8 +34,8 @@ void DependencyGraph::RemoveDependency(Object *parent, Object *child)
|
|||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
|
||||
std::map<Object *, int>& refs = m_Dependencies[child];
|
||||
std::map<Object *, int>::iterator it = refs.find(parent);
|
||||
auto& refs = m_Dependencies[child];
|
||||
auto it = refs.find(parent);
|
||||
|
||||
if (it == refs.end())
|
||||
return;
|
||||
|
|
|
@ -260,17 +260,15 @@ void Process::IOThreadProc(int tid)
|
|||
#endif /* _WIN32 */
|
||||
|
||||
for (int i = 1; i < count; i++) {
|
||||
std::map<ProcessHandle, Process::Ptr>::iterator it;
|
||||
#ifdef _WIN32
|
||||
it = l_Processes[tid].find(handles[i]);
|
||||
auto it = l_Processes[tid].find(handles[i]);
|
||||
#else /* _WIN32 */
|
||||
std::map<ConsoleHandle, ProcessHandle>::iterator it2;
|
||||
it2 = l_FDs[tid].find(pfds[i].fd);
|
||||
auto it2 = l_FDs[tid].find(pfds[i].fd);
|
||||
|
||||
if (it2 == l_FDs[tid].end())
|
||||
continue; /* This should never happen. */
|
||||
|
||||
it = l_Processes[tid].find(it2->second);
|
||||
auto it = l_Processes[tid].find(it2->second);
|
||||
#endif /* _WIN32 */
|
||||
|
||||
if (it == l_Processes[tid].end())
|
||||
|
|
|
@ -193,7 +193,7 @@ void SocketEventEngineEpoll::ChangeEvents(SocketEvents *se, int events)
|
|||
{
|
||||
boost::mutex::scoped_lock lock(m_EventMutex[tid]);
|
||||
|
||||
std::map<SOCKET, SocketEventDescriptor>::iterator it = m_Sockets[tid].find(se->m_FD);
|
||||
auto it = m_Sockets[tid].find(se->m_FD);
|
||||
|
||||
if (it == m_Sockets[tid].end())
|
||||
return;
|
||||
|
|
|
@ -182,7 +182,7 @@ void SocketEventEnginePoll::ChangeEvents(SocketEvents *se, int events)
|
|||
{
|
||||
boost::mutex::scoped_lock lock(m_EventMutex[tid]);
|
||||
|
||||
std::map<SOCKET, SocketEventDescriptor>::iterator it = m_Sockets[tid].find(se->m_FD);
|
||||
auto it = m_Sockets[tid].find(se->m_FD);
|
||||
|
||||
if (it == m_Sockets[tid].end())
|
||||
return;
|
||||
|
|
|
@ -259,7 +259,7 @@ void Timer::TimerThreadProc(void)
|
|||
if (l_StopTimerThread)
|
||||
break;
|
||||
|
||||
NextTimerView::iterator it = idx.begin();
|
||||
auto it = idx.begin();
|
||||
Timer *timer = *it;
|
||||
|
||||
double wait = timer->m_Next - Utility::GetTime();
|
||||
|
|
|
@ -115,7 +115,7 @@ void CheckerComponent::CheckThreadProc(void)
|
|||
if (m_Stopped)
|
||||
break;
|
||||
|
||||
CheckTimeView::iterator it = idx.begin();
|
||||
auto it = idx.begin();
|
||||
CheckableScheduleInfo csi = *it;
|
||||
|
||||
double wait = csi.NextCheck - Utility::GetTime();
|
||||
|
@ -227,8 +227,8 @@ void CheckerComponent::ExecuteCheckHelper(const Checkable::Ptr& checkable)
|
|||
/* remove the object from the list of pending objects; if it's not in the
|
||||
* list this was a manual (i.e. forced) check and we must not re-add the
|
||||
* object to the list because it's already there. */
|
||||
CheckerComponent::CheckableSet::iterator it;
|
||||
it = m_PendingCheckables.find(checkable);
|
||||
auto it = m_PendingCheckables.find(checkable);
|
||||
|
||||
if (it != m_PendingCheckables.end()) {
|
||||
m_PendingCheckables.erase(it);
|
||||
|
||||
|
@ -300,7 +300,8 @@ void CheckerComponent::NextCheckChangedHandler(const Checkable::Ptr& checkable)
|
|||
typedef boost::multi_index::nth_index<CheckableSet, 0>::type CheckableView;
|
||||
CheckableView& idx = boost::get<0>(m_IdleCheckables);
|
||||
|
||||
CheckableView::iterator it = idx.find(checkable);
|
||||
auto it = idx.find(checkable);
|
||||
|
||||
if (it == idx.end())
|
||||
return;
|
||||
|
||||
|
|
|
@ -593,9 +593,9 @@ void TroubleshootCommand::PrintObjectOrigin(InfoLog& log, const std::set<String>
|
|||
InfoLogLine(log)
|
||||
<< "The objects origins are:\n";
|
||||
|
||||
for (std::set<String>::iterator it = configSet.begin(); it != configSet.end(); it++) {
|
||||
for (const String& config : configSet) {
|
||||
InfoLogLine(log)
|
||||
<< " " << *it << '\n';
|
||||
<< " " << config << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ bool ApplyRule::HasMatches(void) const
|
|||
|
||||
std::vector<ApplyRule>& ApplyRule::GetRules(const String& type)
|
||||
{
|
||||
RuleMap::iterator it = m_Rules.find(type);
|
||||
auto it = m_Rules.find(type);
|
||||
if (it == m_Rules.end()) {
|
||||
static std::vector<ApplyRule> emptyList;
|
||||
return emptyList;
|
||||
|
|
|
@ -230,7 +230,7 @@ String Comment::GetCommentIDFromLegacyID(int id)
|
|||
{
|
||||
boost::mutex::scoped_lock lock(l_CommentMutex);
|
||||
|
||||
std::map<int, String>::iterator it = l_LegacyCommentsCache.find(id);
|
||||
auto it = l_LegacyCommentsCache.find(id);
|
||||
|
||||
if (it == l_LegacyCommentsCache.end())
|
||||
return Empty;
|
||||
|
|
|
@ -363,7 +363,7 @@ String Downtime::GetDowntimeIDFromLegacyID(int id)
|
|||
{
|
||||
boost::mutex::scoped_lock lock(l_DowntimeMutex);
|
||||
|
||||
std::map<int, String>::iterator it = l_LegacyDowntimesCache.find(id);
|
||||
auto it = l_LegacyDowntimesCache.find(id);
|
||||
|
||||
if (it == l_LegacyDowntimesCache.end())
|
||||
return Empty;
|
||||
|
|
|
@ -114,8 +114,7 @@ void ExternalCommandProcessor::Execute(double time, const String& command, const
|
|||
{
|
||||
boost::mutex::scoped_lock lock(GetMutex());
|
||||
|
||||
std::map<String, ExternalCommandInfo>::iterator it;
|
||||
it = GetCommands().find(command);
|
||||
auto it = GetCommands().find(command);
|
||||
|
||||
if (it == GetCommands().end())
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument("The external command '" + command + "' does not exist."));
|
||||
|
|
|
@ -92,7 +92,7 @@ void Table::AddColumn(const String& name, const Column& column)
|
|||
{
|
||||
std::pair<String, Column> item = std::make_pair(name, column);
|
||||
|
||||
std::pair<std::map<String, Column>::iterator, bool> ret = m_Columns.insert(item);
|
||||
auto ret = m_Columns.insert(item);
|
||||
|
||||
if (!ret.second)
|
||||
ret.first->second = column;
|
||||
|
|
|
@ -182,7 +182,7 @@ void ClrCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
|
|||
{
|
||||
boost::mutex::scoped_lock lock(l_ObjectsMutex);
|
||||
|
||||
std::map<Checkable::Ptr, variant_t>::iterator it = l_Objects.find(checkable);
|
||||
auto it = l_Objects.find(checkable);
|
||||
|
||||
if (it != l_Objects.end()) {
|
||||
vtObject = it->second;
|
||||
|
|
|
@ -61,8 +61,7 @@ void EventQueue::AddClient(void *client)
|
|||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
|
||||
typedef std::map<void *, std::deque<Dictionary::Ptr> >::iterator it_type;
|
||||
std::pair<it_type, bool> result = m_Events.insert(std::make_pair(client, std::deque<Dictionary::Ptr>()));
|
||||
auto result = m_Events.insert(std::make_pair(client, std::deque<Dictionary::Ptr>()));
|
||||
ASSERT(result.second);
|
||||
}
|
||||
|
||||
|
@ -99,7 +98,7 @@ Dictionary::Ptr EventQueue::WaitForEvent(void *client, double timeout)
|
|||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
|
||||
for (;;) {
|
||||
std::map<void *, std::deque<Dictionary::Ptr> >::iterator it = m_Events.find(client);
|
||||
auto it = m_Events.find(client);
|
||||
ASSERT(it != m_Events.end());
|
||||
|
||||
if (!it->second.empty()) {
|
||||
|
|
|
@ -208,7 +208,7 @@ void Url::SetQuery(const std::map<String, std::vector<String> >& query)
|
|||
|
||||
void Url::AddQueryElement(const String& name, const String& value)
|
||||
{
|
||||
std::map<String, std::vector<String> >::iterator it = m_Query.find(name);
|
||||
auto it = m_Query.find(name);
|
||||
if (it == m_Query.end()) {
|
||||
m_Query[name] = std::vector<String>();
|
||||
m_Query[name].push_back(value);
|
||||
|
@ -395,7 +395,7 @@ bool Url::ParseQuery(const String& query)
|
|||
|
||||
key = Utility::UnescapeString(key);
|
||||
|
||||
std::map<String, std::vector<String> >::iterator it = m_Query.find(key);
|
||||
auto it = m_Query.find(key);
|
||||
|
||||
if (it == m_Query.end()) {
|
||||
m_Query[key] = std::vector<String>();
|
||||
|
|
Loading…
Reference in New Issue