From 4bd1ac2fbfaf72c60dccbfb74554fbd184bb6b58 Mon Sep 17 00:00:00 2001 From: wolframw Date: Thu, 1 Sep 2022 22:12:15 +0200 Subject: [PATCH] improve precondition of std.path.globMatch --- std/path.d | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/std/path.d b/std/path.d index 1bdb8e489..7ff4dd937 100644 --- a/std/path.d +++ b/std/path.d @@ -3357,16 +3357,10 @@ in { // Verify that pattern[] is valid import std.algorithm.searching : balancedParens; + import std.utf : byUTF; - try - { - assert(balancedParens(pattern, '[', ']', 0)); - assert(balancedParens(pattern, '{', '}', 0)); - } - catch (Exception e) - { - assert(0); - } + assert(balancedParens(pattern.byUTF!C, '[', ']', 0)); + assert(balancedParens(pattern.byUTF!C, '{', '}', 0)); } do {