mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 21:51:40 +03:00
Merge pull request #8550 from wolframw/nothrow_contracts2
improve precondition of std.path.globMatch
This commit is contained in:
commit
07bbd10eb9
1 changed files with 3 additions and 9 deletions
12
std/path.d
12
std/path.d
|
@ -3357,16 +3357,10 @@ in
|
||||||
{
|
{
|
||||||
// Verify that pattern[] is valid
|
// Verify that pattern[] is valid
|
||||||
import std.algorithm.searching : balancedParens;
|
import std.algorithm.searching : balancedParens;
|
||||||
|
import std.utf : byUTF;
|
||||||
|
|
||||||
try
|
assert(balancedParens(pattern.byUTF!C, '[', ']', 0));
|
||||||
{
|
assert(balancedParens(pattern.byUTF!C, '{', '}', 0));
|
||||||
assert(balancedParens(pattern, '[', ']', 0));
|
|
||||||
assert(balancedParens(pattern, '{', '}', 0));
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue