Skip to content

Commit

Permalink
Merge 1196661 into 7dfe04c
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 3, 2024
2 parents 7dfe04c + 1196661 commit 69abda5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ql/time/asx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace QuantLib {
return false;

// 2nd character of code needs to be digit
if (!std::isdigit(static_cast<unsigned char>(in[1])))
if (std::isdigit(static_cast<unsigned char>(in[1])) == 0)
return false;

// 1st character needs to represent the correct month
Expand Down Expand Up @@ -101,7 +101,7 @@ namespace QuantLib {
QL_ASSERT(idxZeroBased != All_MONTH_CODES.npos, "invalid ASX month letter. code: " + asxCode);

// QuantLib::Month is 1-based!
const QuantLib::Month m = static_cast<QuantLib::Month>(idxZeroBased + 1);
const auto m = static_cast<QuantLib::Month>(idxZeroBased + 1);

// convert 2nd char to year digit
Year y = static_cast<int>(asxCode[1]) - static_cast<int>('0');
Expand Down
8 changes: 4 additions & 4 deletions ql/time/ecb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace QuantLib {
//clang-format off
// Start of maintenance period
// source: https://web.archive.org/web/20230610050642/https://www.ecb.europa.eu/press/calendars/reserve/html/index.en.html
static std::set<Date> ecbKnownDateSet = {
std::set<Date> ecbKnownDateSet = {
// 2005
Date(38371), Date(38391), Date(38420), Date(38455), Date(38483), Date(38511),
Date(38546), Date(38574), Date(38602), Date(38637), Date(38665), Date(38692),
Expand Down Expand Up @@ -261,8 +261,8 @@ namespace QuantLib {
}

// 4th, 5th characters need to be digit
return std::isdigit(static_cast<unsigned char>(ecbCode[3]))
&& std::isdigit(static_cast<unsigned char>(ecbCode[4]));
return (std::isdigit(static_cast<unsigned char>(ecbCode[3])) != 0)
&& (std::isdigit(static_cast<unsigned char>(ecbCode[4])) != 0);
}

string ECB::nextCode(const std::string& ecbCode) {
Expand All @@ -276,7 +276,7 @@ namespace QuantLib {
nextCodeStr.reserve(5);
if (monthEnum != December) {
// use next month
const Month nextMonthEnum = static_cast<Month>(monthEnum + 1);
const auto nextMonthEnum = static_cast<Month>(monthEnum + 1);
const boost::string_view nextMonth = MONTHS.right.at(nextMonthEnum);
nextCodeStr.append(nextMonth.data(), 3);

Expand Down
5 changes: 3 additions & 2 deletions test-suite/quantlibbenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@

#include <iomanip>
#include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <utility>
Expand Down Expand Up @@ -254,8 +255,8 @@ namespace {

class TimedBenchmark {
public:
TimedBenchmark(std::function<void(void)> f, const std::string& name)
: f_(std::move(f)), name_(name) {}
TimedBenchmark(std::function<void(void)> f, std::string name)
: f_(std::move(f)), name_(std::move(name)) {}

void startMeasurement() const {
//QL_REQUIRE(PAPI_hl_region_begin(name_.c_str()) == PAPI_OK,
Expand Down

0 comments on commit 69abda5

Please sign in to comment.