From 1c9242bab22f781a734cff1cb9e61e5e8661749e Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 4 Jun 2024 11:13:36 +0200 Subject: [PATCH] LayoutBuilder: Potentially save a few cycles ... by not actually creating the unused instances of the Id types. Change-Id: I6955046fa1b457ea70d36090d3bf0051b31dfdaa Reviewed-by: Marcus Tillmanns --- tests/manual/layoutbuilder/v2/lb.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/manual/layoutbuilder/v2/lb.h b/tests/manual/layoutbuilder/v2/lb.h index 99c87af564b..cdccc858701 100644 --- a/tests/manual/layoutbuilder/v2/lb.h +++ b/tests/manual/layoutbuilder/v2/lb.h @@ -43,13 +43,12 @@ namespace Layouting { class NestId {}; -template +template class IdAndArg { public: - IdAndArg(const T1 &id, const T2 &arg) : id(id), arg(arg) {} - const T1 id; - const T2 arg; // FIXME: Could be const &, but this would currently break bindTo(). + IdAndArg(Id, const Arg &arg) : arg(arg) {} + const Arg arg; // FIXME: Could be const &, but this would currently break bindTo(). }; // The main dispatcher @@ -70,7 +69,7 @@ public: template BuilderItem(IdAndArg && idarg) { - apply = [&idarg](X *x) { doit(x, idarg.id, idarg.arg); }; + apply = [&idarg](X *x) { doit(x, Id{}, idarg.arg); }; } std::function apply;