Skip to content

Commit 077887b

Browse files
committed
Merge pull request #1683 from monarchdodra/AppenderFixup
fix reg in appender
2 parents d743e6c + b207491 commit 077887b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

std/array.d

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,6 +2361,7 @@ struct Appender(A : T[], T)
23612361
emplace(&it, items.front);
23622362
else
23632363
it = items.front;
2364+
items.popFront();
23642365
}
23652366
}
23662367
else
@@ -2372,6 +2373,7 @@ struct Appender(A : T[], T)
23722373
emplace(&it, getUItem(items.front));
23732374
else
23742375
it = getUItem(items.front);
2376+
items.popFront();
23752377
}
23762378
}
23772379

@@ -2874,6 +2876,14 @@ unittest
28742876
assert(app3.data == [1, 2, 3]);
28752877
}
28762878

2879+
unittest
2880+
{
2881+
Appender!(int[]) app;
2882+
short[] range = [1, 2, 3];
2883+
app.put(range);
2884+
assert(app.data == [1, 2, 3]);
2885+
}
2886+
28772887
/*
28782888
A simple slice type only holding pointers to the beginning and the end
28792889
of an array. Experimental duplication of the built-in slice - do not

0 commit comments

Comments
 (0)