Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asl committed Feb 23, 2024
1 parent e4391f5 commit 8385379
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/gtest/parser_unroll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ class MidEnd : public PassManager {
#endif

const IR::P4Parser *getParser(const IR::P4Program *program) {
// FIXME: This certainly should be improved
std::function<bool(const IR::IDeclaration *)> filter = [](const IR::IDeclaration *d) {
CHECK_NULL(d);
return d->is<IR::P4Parser>();
};
return program->getDeclarations()->where(filter)->single()->to<IR::P4Parser>();
// FIXME: This certainly should be improved, it should be possible to check
// and cast at the same time
return program->getDeclarations()
->where([](const IR::IDeclaration *d) { return d->is<IR::P4Parser>(); })
->single()
->to<IR::P4Parser>();
}

/// Rewrites parser
Expand Down

0 comments on commit 8385379

Please sign in to comment.