Removed unused/untested code from AppenderNoGCFixed.

This commit is contained in:
Ferdinand Majerech 2014-07-29 01:50:04 +02:00
parent 4a4e83112c
commit 6e1239fdac

View file

@ -153,10 +153,6 @@ struct AppenderNoGCFixed(A : T[], T)
{ {
// initialize to a given array. // initialize to a given array.
_data.arr = cast(Unqual!T[])arr[0 .. 0]; //trusted _data.arr = cast(Unqual!T[])arr[0 .. 0]; //trusted
if (__ctfe)
return;
_data.capacity = arr.length; _data.capacity = arr.length;
} }
@ -188,23 +184,6 @@ struct AppenderNoGCFixed(A : T[], T)
"AppenderFixed ran out of space"); "AppenderFixed ran out of space");
} }
/**
* Appends one item to the managed array.
*/
void put(U)(U item) if (is(Unqual!U == T))
{
ensureAddable(1);
immutable len = _data.arr.length;
auto bigDataFun() @trusted nothrow { return _data.arr.ptr[0 .. len + 1];}
auto bigData = bigDataFun();
emplaceRef!T(bigData[len], item);
//We do this at the end, in case of exceptions
_data.arr = bigData;
}
void put(U)(U[] items) if (is(Unqual!U == T)) void put(U)(U[] items) if (is(Unqual!U == T))
{ {
// make sure we have enough space, then add the items // make sure we have enough space, then add the items
@ -244,7 +223,6 @@ struct AppenderNoGCFixed(A : T[], T)
@disable void clear(); @disable void clear();
} }
} }
unittest unittest
{ {
char[256] buffer; char[256] buffer;