const string &FormData::get_value(const string &key) const
{
- map<string, string>::const_iterator i = fields.find(key);
+ auto i = fields.find(key);
if(i==fields.end())
{
static string dummy;
char value_sep = (style==VALUE_WITH_ATTRIBUTES ? 0 : ',');
- string::const_iterator i = raw_value.begin();
- while(i!=raw_value.end())
+ auto i = raw_value.cbegin();
+ while(i!=raw_value.cend())
{
Value value;
- string::const_iterator start = i;
+ auto start = i;
if(style==KEY_VALUE_LIST)
value.value = name;
else
if(complete)
return 0;
- HeaderMap::const_iterator i = headers.find("Content-Length");
+ auto i = headers.find("Content-Length");
if(i!=headers.end())
{
string::size_type needed = lexical_cast<string::size_type>(i->second)-content.size();
while(!clients.empty() && poller.poll(timeout))
{
for(const IO::Poller::PolledObject &p: poller.get_result())
- for(list<Client>::iterator j=clients.begin(); j!=clients.end(); ++j)
+ for(auto j=clients.begin(); j!=clients.end(); ++j)
if(j->sock.get()==p.object)
{
poller.set_object(*j->sock, IO::P_NONE);
void Server::client_data_available(Client &cl)
{
- for(list<Client>::iterator i=clients.begin(); i!=clients.end(); ++i)
+ for(auto i=clients.begin(); i!=clients.end(); ++i)
if(i->stale && &*i!=&cl)
{
clients.erase(i);
Task *task = 0;
{
MutexLock lock(queue_mutex);
- for(deque<Task>::iterator i=queue.begin(); (!task && i!=queue.end()); ++i)
+ for(auto i=queue.begin(); (!task && i!=queue.end()); ++i)
if(!i->is_complete())
task = &*i;
}