Skip to content

Commit 931aad7

Browse files
authored
Merge pull request #114 from dlang-community/derp
Correctly reset t-tree length field to zero when clearing merged-on-behalf-of: Brian Schott <Hackerpilot@users.noreply.github.com>
2 parents 64ef163 + e620c39 commit 931aad7

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/containers/ttree.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ struct TTree(T, Allocator = Mallocator, bool allowDuplicates = false,
7373
*/
7474
void clear()
7575
{
76+
_length = 0;
7677
if (root is null)
7778
return;
7879
static if (stateSize!Allocator > 0)

src/containers/unrolledlist.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ struct UnrolledList(T, Allocator = Mallocator,
211211
*/
212212
bool remove(T item)
213213
{
214-
import containers.internal.backwards : popcnt;
215214
if (_front is null)
216215
return false;
217216
bool retVal;
@@ -344,7 +343,6 @@ struct UnrolledList(T, Allocator = Mallocator,
344343
}
345344
body
346345
{
347-
import containers.internal.backwards : popcnt;
348346
size_t i = nodeCapacity - 1;
349347
while (_back.isFree(i))
350348
{

0 commit comments

Comments
 (0)