mirror of https://github.com/aria2/aria2
Removed temporary string
parent
6ed36b73c1
commit
7f8724c501
|
@ -134,17 +134,23 @@ bool parseDate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!foundMonth) {
|
if(!foundMonth) {
|
||||||
static std::string MONTH[] = {
|
static const char MONTH[][12] = {
|
||||||
"jan", "feb", "mar", "apr",
|
"jan", "feb", "mar", "apr",
|
||||||
"may", "jun", "jul", "aug",
|
"may", "jun", "jul", "aug",
|
||||||
"sep", "oct", "nov", "dec" };
|
"sep", "oct", "nov", "dec" };
|
||||||
if((*i).size() >= 3) {
|
if((*i).size() >= 3) {
|
||||||
std::string head((*i).begin(), (*i).begin()+3);
|
bool found = false;
|
||||||
util::lowercase(head);
|
size_t j;
|
||||||
std::string* mptr = std::find(vbegin(MONTH), vend(MONTH), head);
|
for(j = 0; j < 12; ++j) {
|
||||||
if(mptr != vend(MONTH)) {
|
if(util::strieq((*i).begin(), (*i).begin()+3,
|
||||||
|
&MONTH[j][0], &MONTH[j][3])) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(found) {
|
||||||
foundMonth = true;
|
foundMonth = true;
|
||||||
month = std::distance(vbegin(MONTH), mptr)+1;
|
month = j+1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue