Mercurial > projects > ldc
annotate tests/mini/slices2.d @ 1633:5c0cebff9be8
Improve array append performance.
Actually use the appropriate runtime function, instead of just
growing the array by one!
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 14 Feb 2010 10:11:05 +0100 |
parents | bb4a81e68ddb |
children |
rev | line source |
---|---|
820
bb4a81e68ddb
Implemented allocating storage for a slice if its address is taken, fixes #115
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
1 void main() |
bb4a81e68ddb
Implemented allocating storage for a slice if its address is taken, fixes #115
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
2 { |
bb4a81e68ddb
Implemented allocating storage for a slice if its address is taken, fixes #115
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
3 int[10] arr = void; |
bb4a81e68ddb
Implemented allocating storage for a slice if its address is taken, fixes #115
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
4 int[]* ptr = &arr[1..3]; |
bb4a81e68ddb
Implemented allocating storage for a slice if its address is taken, fixes #115
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff
changeset
|
5 } |