From 66e26430727bc76557b99c8e2b136901c5a38f90 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 8 Jan 2016 00:39:05 +0100 Subject: QDialogButtonBox: replace a QList copy + pop_front() with mid(1) Simplifies the code and is also more efficient, because it copies less data. Change-Id: I9ad0c372fb4fa6f5818d9d6cb7b7cf35935f8565 Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qdialogbuttonbox.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index 00e0774012..6fc8cb5e26 100644 --- a/src/widgets/widgets/qdialogbuttonbox.cpp +++ b/src/widgets/widgets/qdialogbuttonbox.cpp @@ -288,13 +288,8 @@ void QDialogButtonBoxPrivate::layoutButtons() } break; case QPlatformDialogHelper::AlternateRole: - { - if (acceptRoleList.size() < 2) - break; - QList list = acceptRoleList; - list.removeFirst(); - addButtonsToLayout(list, reverse); - } + if (acceptRoleList.size() > 1) + addButtonsToLayout(acceptRoleList.mid(1), reverse); break; case QPlatformDialogHelper::DestructiveRole: { -- cgit v1.2.3