From 8385379601060edd3ec85b00b88e66e937b0f0ec Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Wed, 21 Feb 2024 11:47:25 -0800 Subject: [PATCH] Address review comments --- test/gtest/parser_unroll.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/gtest/parser_unroll.cpp b/test/gtest/parser_unroll.cpp index 92afd442973..e9410f15827 100644 --- a/test/gtest/parser_unroll.cpp +++ b/test/gtest/parser_unroll.cpp @@ -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 filter = [](const IR::IDeclaration *d) { - CHECK_NULL(d); - return d->is(); - }; - return program->getDeclarations()->where(filter)->single()->to(); + // 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(); }) + ->single() + ->to(); } /// Rewrites parser