Skip to content

Commit 54278d0

Browse files
committed
minor refactorings
1 parent 6a2492c commit 54278d0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

cucumber_cpp/library/api/RunCucumber.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,27 +81,27 @@ namespace cucumber_cpp::library::api
8181

8282
void EmitTestCaseHooks(support::SupportCodeLibrary& supportCodeLibrary, util::Broadcaster& broadcaster)
8383
{
84-
const auto beforeAllHooks = supportCodeLibrary.hookRegistry.HooksByType(HookType::before);
84+
auto beforeAllHooks = supportCodeLibrary.hookRegistry.HooksByType(HookType::before);
8585

86-
for (const auto& hook : beforeAllHooks)
86+
for (auto& hook : beforeAllHooks)
8787
broadcaster.BroadcastEvent({ .hook = std::move(hook) });
8888

89-
const auto afterAllHooks = supportCodeLibrary.hookRegistry.HooksByType(HookType::after);
89+
auto afterAllHooks = supportCodeLibrary.hookRegistry.HooksByType(HookType::after);
9090

91-
for (const auto& hook : afterAllHooks)
91+
for (auto& hook : afterAllHooks)
9292
broadcaster.BroadcastEvent({ .hook = std::move(hook) });
9393
}
9494

9595
void EmitTestRunHooks(support::SupportCodeLibrary& supportCodeLibrary, util::Broadcaster& broadcaster)
9696
{
97-
const auto beforeAllHooks = supportCodeLibrary.hookRegistry.HooksByType(HookType::beforeAll);
97+
auto beforeAllHooks = supportCodeLibrary.hookRegistry.HooksByType(HookType::beforeAll);
9898

99-
for (const auto& hook : beforeAllHooks)
99+
for (auto& hook : beforeAllHooks)
100100
broadcaster.BroadcastEvent({ .hook = std::move(hook) });
101101

102-
const auto afterAllHooks = supportCodeLibrary.hookRegistry.HooksByType(HookType::afterAll);
102+
auto afterAllHooks = supportCodeLibrary.hookRegistry.HooksByType(HookType::afterAll);
103103

104-
for (const auto& hook : afterAllHooks)
104+
for (auto& hook : afterAllHooks)
105105
broadcaster.BroadcastEvent({ .hook = std::move(hook) });
106106
}
107107

cucumber_cpp/library/assemble/AssembleTestSuites.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ namespace cucumber_cpp::library::assemble
121121
std::vector<AssembledTestSuite> assembledTestSuites;
122122
assembledTestSuites.reserve(assembledTestSuiteMap.size());
123123

124-
for (auto uri : testUris)
124+
for (const auto& uri : testUris)
125125
assembledTestSuites.emplace_back(std::move(assembledTestSuiteMap.at(uri)));
126126

127127
return assembledTestSuites;

0 commit comments

Comments
 (0)