Skip to content

Commit

Permalink
Avoid extra copies
Browse files Browse the repository at this point in the history
  • Loading branch information
vlstill committed Nov 22, 2023
1 parent 22dda8a commit 720d13f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/gtest/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ namespace Test {
const std::string &source,
CompilerOptions::FrontendVersion langVersion
/* = CompilerOptions::FrontendVersion::P4_16 */,
P4::ParseAnnotations parseAnnotations
const P4::ParseAnnotations &parseAnnotations
/* = P4::ParseAnnotations() */) {
auto *program = P4::parseP4String(source, langVersion);
if (program == nullptr) {
Expand Down
4 changes: 2 additions & 2 deletions test/gtest/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ struct FrontendTestCase {
/// Create a test case that only requires the frontend to run.
static std::optional<FrontendTestCase> create(
const std::string &source, CompilerOptions::FrontendVersion langVersion = defaultVersion,
P4::ParseAnnotations parseAnnotations = P4::ParseAnnotations());
const P4::ParseAnnotations &parseAnnotations = P4::ParseAnnotations());

static std::optional<FrontendTestCase> create(const std::string &source,
P4::ParseAnnotations parseAnnotations) {
const P4::ParseAnnotations &parseAnnotations) {
return create(source, defaultVersion, parseAnnotations);
}

Expand Down

0 comments on commit 720d13f

Please sign in to comment.