From 6e1239fdacec6119cf0c3548160b46d2cace0500 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Tue, 29 Jul 2014 01:50:04 +0200 Subject: [PATCH] Removed unused/untested code from AppenderNoGCFixed. --- source/dyaml/nogcutil.d | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/source/dyaml/nogcutil.d b/source/dyaml/nogcutil.d index 09511dd..7d996ac 100644 --- a/source/dyaml/nogcutil.d +++ b/source/dyaml/nogcutil.d @@ -153,10 +153,6 @@ struct AppenderNoGCFixed(A : T[], T) { // initialize to a given array. _data.arr = cast(Unqual!T[])arr[0 .. 0]; //trusted - - if (__ctfe) - return; - _data.capacity = arr.length; } @@ -188,23 +184,6 @@ struct AppenderNoGCFixed(A : T[], T) "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)) { // make sure we have enough space, then add the items @@ -244,7 +223,6 @@ struct AppenderNoGCFixed(A : T[], T) @disable void clear(); } } - unittest { char[256] buffer;