Skip points to check when there are no pointers

This commit is contained in:
monarchdodra 2013-09-27 14:00:51 +02:00
parent f0f2c6f310
commit ed914dfd10

View file

@ -1946,8 +1946,9 @@ if (isMutable!T && !is(typeof(T.init.proxySwap(T.init))))
{
// For structs with non-trivial assignment, move memory directly
// First check for undue aliasing
assert(!pointsTo(lhs, rhs) && !pointsTo(rhs, lhs)
&& !pointsTo(lhs, lhs) && !pointsTo(rhs, rhs));
static if (hasIndirections!T)
assert(!pointsTo(lhs, rhs) && !pointsTo(rhs, lhs)
&& !pointsTo(lhs, lhs) && !pointsTo(rhs, rhs));
// Swap bits
ubyte[T.sizeof] t = void;
auto a = (cast(ubyte*) &lhs)[0 .. T.sizeof];