Skip to content

Commit bc74469

Browse files
committed
DPL: remove bloat
Exposing std::regex not really needed.
1 parent b77f031 commit bc74469

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

Framework/Core/include/Framework/DataDescriptorQueryBuilder.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
#include <string>
1717
#include <vector>
1818
#include <memory>
19-
#include <regex>
2019

21-
namespace o2
22-
{
23-
namespace framework
20+
21+
namespace o2::framework
2422
{
2523

2624
namespace data_matcher
@@ -65,9 +63,9 @@ struct DataDescriptorQueryBuilder {
6563
/// deprecated?
6664
static DataDescriptorQuery buildFromExtendedKeepConfig(std::string const& config);
6765
static std::unique_ptr<data_matcher::DataDescriptorMatcher> buildNode(std::string const& nodeString);
68-
static std::smatch getTokens(std::string const& nodeString);
66+
static std::vector<std::string> getTokens(std::string const& nodeString);
6967
};
7068

71-
} // namespace framework
72-
} // namespace o2
69+
} // namespace o2::framework
70+
7371
#endif // o2_framework_DataDescriptorQueryBuilder_H_INCLUDED

Framework/Core/src/DataDescriptorQueryBuilder.cxx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <optional>
1818
#include <string>
1919
#include <vector>
20+
#include <regex>
2021
#include <iostream>
2122

2223
using namespace o2::framework::data_matcher;
@@ -447,7 +448,7 @@ DataDescriptorQuery DataDescriptorQueryBuilder::buildFromExtendedKeepConfig(std:
447448
std::unique_ptr<DataDescriptorMatcher> DataDescriptorQueryBuilder::buildNode(std::string const& nodeString)
448449
{
449450

450-
std::smatch m = getTokens(nodeString);
451+
auto m = getTokens(nodeString);
451452

452453
std::unique_ptr<DataDescriptorMatcher> next;
453454
auto newNode = std::make_unique<DataDescriptorMatcher>(
@@ -461,15 +462,19 @@ std::unique_ptr<DataDescriptorMatcher> DataDescriptorQueryBuilder::buildNode(std
461462
return newNode;
462463
}
463464

464-
std::smatch DataDescriptorQueryBuilder::getTokens(std::string const& nodeString)
465+
std::vector<std::string> DataDescriptorQueryBuilder::getTokens(std::string const& nodeString)
465466
{
466467

467468
static const std::regex specTokenRE(R"re((\w{1,4})/(\w{1,16})/(\d*))re");
468-
std::smatch m;
469+
std::smatch match;
469470

470-
std::regex_match(nodeString, m, specTokenRE);
471+
std::regex_match(nodeString, match, specTokenRE);
471472

472-
return m;
473+
std::vector<std::string> result;
474+
for (size_t i = 0; i < 4; ++i) {
475+
result.push_back(match[i].str());
476+
}
477+
return result;
473478
}
474479

475480
} // namespace o2::framework

0 commit comments

Comments
 (0)