From fa2cddad3427f37e7721f21e354727300f64553b Mon Sep 17 00:00:00 2001 From: and3md Date: Thu, 23 Mar 2017 18:16:44 +0100 Subject: [PATCH] Change try..finally to more compact scope(exit) --- src/dlangui/widgets/controls.d | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/dlangui/widgets/controls.d b/src/dlangui/widgets/controls.d index fdf77dea..e550594e 100644 --- a/src/dlangui/widgets/controls.d +++ b/src/dlangui/widgets/controls.d @@ -498,14 +498,8 @@ class RadioButton : ImageTextButton { RadioButton rb = cast(RadioButton)child; if (rb) { rb.blockUnchecking = true; - try - { - rb.checked = false; - } - finally - { - rb.blockUnchecking = false; - } + scope(exit) rb.blockUnchecking = false; + rb.checked = false; } } }