mirror of
https://github.com/PerMalmberg/libcron.git
synced 2025-04-22 00:13:01 -05:00
#1 Build on clang.
This commit is contained in:
parent
802d8e724e
commit
e725abf87f
@ -11,7 +11,8 @@ namespace libcron
|
||||
class CronData
|
||||
{
|
||||
public:
|
||||
static const std::array<Months, 7> months_with_31;
|
||||
static const int NUMBER_OF_LONG_MONTHS = 7;
|
||||
static const libcron::Months months_with_31[NUMBER_OF_LONG_MONTHS];
|
||||
|
||||
static CronData create(const std::string& cron_expression);
|
||||
|
||||
|
@ -5,7 +5,7 @@ using namespace date;
|
||||
|
||||
namespace libcron
|
||||
{
|
||||
const constexpr std::array<Months, 7> CronData::months_with_31{ Months::January,
|
||||
const constexpr Months CronData::months_with_31[NUMBER_OF_LONG_MONTHS] = { Months::January,
|
||||
Months::March,
|
||||
Months::May,
|
||||
Months::July,
|
||||
@ -98,7 +98,7 @@ namespace libcron
|
||||
{
|
||||
res = false;
|
||||
|
||||
for (size_t i = 0; !res && i < months_with_31.size(); ++i)
|
||||
for (size_t i = 0; !res && i < NUMBER_OF_LONG_MONTHS; ++i)
|
||||
{
|
||||
res = months.find(months_with_31[i]) != months.end();
|
||||
}
|
||||
|
@ -87,9 +87,9 @@ namespace libcron
|
||||
// Limit to 29 days, possibly causing delaying schedule until next leap year.
|
||||
max = std::min(max, 29);
|
||||
}
|
||||
else if (std::find(CronData::months_with_31.begin(),
|
||||
CronData::months_with_31.end(),
|
||||
month) == CronData::months_with_31.end())
|
||||
else if (std::find(std::begin(CronData::months_with_31),
|
||||
std::end(CronData::months_with_31),
|
||||
month) == std::end(CronData::months_with_31))
|
||||
{
|
||||
// Not among the months with 31 days
|
||||
max = std::min(max, 30);
|
||||
|
Loading…
x
Reference in New Issue
Block a user