From 986c1fc106fa4204c5671215b7772612ca0dfba0 Mon Sep 17 00:00:00 2001 From: Anton Pastukhov Date: Tue, 26 Nov 2024 20:46:00 +0200 Subject: [PATCH] Remove redundant try/catch --- src/dlangui/core/collections.d | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/dlangui/core/collections.d b/src/dlangui/core/collections.d index b62191ef..e2e3cf80 100644 --- a/src/dlangui/core/collections.d +++ b/src/dlangui/core/collections.d @@ -249,15 +249,11 @@ struct ObjectList(T) { return _list[index]; } /// get item by index. Returns null if item not found - inout(T) tryGet(int index) @safe inout nothrow { - try { - if (index < 0 || index >= _count) { - return null; - } - return _list[index]; - } catch (Exception e) { + inout(T) tryGet(int index) @safe inout { + if (index < 0 || index >= _count) { return null; } + return _list[index]; } /// get item by index T opIndex(int index) @safe {