Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use pre-sized ArrayList instead of LinkedList in compilejastlist
  • Loading branch information
donaldh committed Sep 25, 2013
1 parent 6758068 commit c8351fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -5098,7 +5098,7 @@ public static SixModelObject bitshiftr_I(SixModelObject a, long b, SixModelObjec
public static SixModelObject compilejastlines(SixModelObject dump, ThreadContext tc) {
if (dump instanceof VMArrayInstance) {
VMArrayInstance array = (VMArrayInstance) dump;
List<String> lines = new LinkedList<String>();
List<String> lines = new ArrayList<String>(array.elems);
for (int index = 0; index < array.elems; index++) {
lines.add(array.at_pos_boxed(tc, index).get_str(tc));
}
Expand All @@ -5118,7 +5118,7 @@ public static SixModelObject compilejast(String dump, ThreadContext tc) {
public static SixModelObject compilejastlinestofile(SixModelObject dump, String filename, ThreadContext tc) {
if (dump instanceof VMArrayInstance) {
VMArrayInstance array = (VMArrayInstance) dump;
List<String> lines = new LinkedList<String>();
List<String> lines = new ArrayList<String>(array.elems);
for (int index = 0; index < array.elems; index++) {
lines.add(array.at_pos_boxed(tc, index).get_str(tc));
}
Expand Down

0 comments on commit c8351fe

Please sign in to comment.