Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit d517120

Browse files
authored
Merge pull request #2794 from WalterBright/utilArrayError
core/internal/array.d: replace Error with assert()
2 parents ab2e18c + dda8873 commit d517120

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/internal/util/array.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private void _enforceSameLength(const char[] action,
4444
msg ~= length1.unsignedToTempString(tmpBuff, 10);
4545
msg ~= " != ";
4646
msg ~= length2.unsignedToTempString(tmpBuff, 10);
47-
throw new Error(msg);
47+
assert(0, msg);
4848
}
4949

5050
private void _enforceNoOverlap(const char[] action,
@@ -62,7 +62,7 @@ private void _enforceNoOverlap(const char[] action,
6262
msg ~= overlappedBytes.unsignedToTempString(tmpBuff, 10);
6363
msg ~= " byte(s) overlap of ";
6464
msg ~= bytes.unsignedToTempString(tmpBuff, 10);
65-
throw new Error(msg);
65+
assert(0, msg);
6666
}
6767

6868
private uintptr_t arrayToPtr(const void[] array) @trusted

0 commit comments

Comments
 (0)