]> git.tdb.fi Git - libs/net.git/commitdiff
Use maputils.h
authorMikko Rasa <tdb@tdb.fi>
Wed, 10 Aug 2011 18:05:52 +0000 (21:05 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 10 Aug 2011 18:05:52 +0000 (21:05 +0300)
source/message.cpp

index c9638d0a05b3d938e0cb6b876df59fa80686e901..2b3e40b539d9208138153d6401d453e17a590cee 100644 (file)
@@ -1,4 +1,5 @@
 #include <cstdlib>
+#include <msp/core/maputils.h>
 #include <msp/strings/formatter.h>
 #include <msp/strings/utils.h>
 #include "message.h"
@@ -26,11 +27,7 @@ bool Message::has_header(const string &hdr) const
 
 const string &Message::get_header(const string &hdr) const
 {
-       HeaderMap::const_iterator i = headers.find(normalize_header_name(hdr));
-       if(i==headers.end())
-               throw KeyError("Undefined header", hdr);
-
-       return i->second;
+       return get_item(headers, normalize_header_name(hdr));
 }
 
 void Message::add_content(const string &d)