提交 fcc74b1e 编写于 作者: V vkarnauk

6436314: Vector could be created with appropriate size in DefaultComboBoxModel

Reviewed-by: alexsch, alexp
上级 85e0a557
/*
* Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -55,8 +55,7 @@ public class DefaultComboBoxModel<E> extends AbstractListModel<E> implements Mut
* @param items an array of Object objects
*/
public DefaultComboBoxModel(final E items[]) {
objects = new Vector<E>();
objects.ensureCapacity( items.length );
objects = new Vector<E>(items.length);
int i,c;
for ( i=0,c=items.length;i<c;i++ )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册