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

Commit 0217604

Browse files
authored
Merge pull request #2774 from JinShil/remove_unused
Remove some unused code from object.d merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2 parents 70e0ad3 + 487d962 commit 0217604

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

src/object.d

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,39 +2748,6 @@ if (is(typeof(create()) : V) && is(typeof(update(aa[K.init])) : V))
27482748
assert(a["1"] == -2);
27492749
}
27502750

2751-
version (none)
2752-
{
2753-
// enforce() copied from Phobos std.contracts for destroy(), left out until
2754-
// we decide whether to use it.
2755-
2756-
2757-
T _enforce(T, string file = __FILE__, int line = __LINE__)
2758-
(T value, lazy const(char)[] msg = null)
2759-
{
2760-
if (!value) bailOut(file, line, msg);
2761-
return value;
2762-
}
2763-
2764-
T _enforce(T, string file = __FILE__, int line = __LINE__)
2765-
(T value, scope void delegate() dg)
2766-
{
2767-
if (!value) dg();
2768-
return value;
2769-
}
2770-
2771-
T _enforce(T)(T value, lazy Exception ex)
2772-
{
2773-
if (!value) throw ex();
2774-
return value;
2775-
}
2776-
2777-
private void _bailOut(string file, int line, in char[] msg)
2778-
{
2779-
char[21] buf = void;
2780-
throw new Exception(cast(string)(file ~ "(" ~ ulongToString(buf[], line) ~ "): " ~ (msg ? msg : "Enforcement failed")));
2781-
}
2782-
}
2783-
27842751
version (CoreDdoc)
27852752
{
27862753
// This lets DDoc produce better documentation.

0 commit comments

Comments
 (0)