Menu

#1 TVector.toStringArray() should test for null

open
nobody
None
5
2004-03-30
2004-03-30
Anonymous
No

... and a direct access ist faster than the enumeration.

public final static String[] toStringArray( Vector vect )
{
if ( vect == null )
return null;

int size = vect.size();
String[] result = new String[ size ];

for ( int i = 0; i < size; i++ )
result[i] = vect.elementAt( i ).toString();

return result;
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.