|
a/src/rcldb/rcldb.cpp |
|
b/src/rcldb/rcldb.cpp |
|
... |
|
... |
1476 |
}
|
1476 |
}
|
1477 |
|
1477 |
|
1478 |
// Walk the Y terms and return min/max
|
1478 |
// Walk the Y terms and return min/max
|
1479 |
bool Db::maxYearSpan(int *minyear, int *maxyear)
|
1479 |
bool Db::maxYearSpan(int *minyear, int *maxyear)
|
1480 |
{
|
1480 |
{
|
|
|
1481 |
LOGDEB(("Rcl::Db:maxYearSpan\n"));
|
1481 |
*minyear = 1000000;
|
1482 |
*minyear = 1000000;
|
1482 |
*maxyear = -1000000;
|
1483 |
*maxyear = -1000000;
|
1483 |
TermMatchResult result;
|
1484 |
TermMatchResult result;
|
1484 |
if (!termMatch(ET_WILD, string(), "*", result, -1, "xapyear"))
|
1485 |
if (!termMatch(ET_WILD, string(), "*", result, -1, "xapyear")) {
|
|
|
1486 |
LOGINFO(("Rcl::Db:maxYearSpan: termMatch failed\n"));
|
1485 |
return false;
|
1487 |
return false;
|
|
|
1488 |
}
|
1486 |
for (vector<TermMatchEntry>::const_iterator it = result.entries.begin();
|
1489 |
for (vector<TermMatchEntry>::const_iterator it = result.entries.begin();
|
1487 |
it != result.entries.end(); it++) {
|
1490 |
it != result.entries.end(); it++) {
|
1488 |
if (!it->term.empty()) {
|
1491 |
if (!it->term.empty()) {
|
1489 |
int year = atoi(it->term.c_str()+1);
|
1492 |
int year = atoi(strip_prefix(it->term).c_str());
|
1490 |
if (year < *minyear)
|
1493 |
if (year < *minyear)
|
1491 |
*minyear = year;
|
1494 |
*minyear = year;
|
1492 |
if (year > *maxyear)
|
1495 |
if (year > *maxyear)
|
1493 |
*maxyear = year;
|
1496 |
*maxyear = year;
|
1494 |
}
|
1497 |
}
|