2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Rewritten.
	* src/TaggedItem.cc (toTagString)
pull/1/head
Tatsuhiro Tsujikawa 2008-05-11 13:19:20 +00:00
parent 4e3c08d50c
commit b22e86a6eb
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten.
* src/TaggedItem.cc (toTagString)
2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten Accept-Features handling. Rewritten Accept-Features handling.

View File

@ -34,7 +34,6 @@
/* copyright --> */ /* copyright --> */
#include "TaggedItem.h" #include "TaggedItem.h"
#include "a2functional.h" #include "a2functional.h"
#include <numeric>
#include <algorithm> #include <algorithm>
namespace aria2 { namespace aria2 {
@ -42,7 +41,12 @@ namespace aria2 {
std::string TaggedItem::toTagString() const std::string TaggedItem::toTagString() const
{ {
if(_tags.size()) { if(_tags.size()) {
return std::accumulate(_tags.begin()+1, _tags.end(), _tags.front(), Concat(",")); std::string s(*_tags.begin());
for(std::deque<std::string>::const_iterator i = _tags.begin()+1;
i != _tags.end(); ++i) {
s += ","+(*i);
}
return s;
} else { } else {
return ""; return "";
} }