Hello Diethelm,

Thursday, October 05, 2000, 1:41:47 AM, you wrote:


DGG> Quick solution: would it be Ok to replace that code with

DGG>   Vector packages = TurbineResources.getVector("module.packages");
DGG>   String basePackage = GenericLoader.getBasePackage();
DGG>   if (! vector.contains(basePackage))
DGG>     packages.addElement( basePackage );

What about creating new instance of vector?
It can be faster than looping through vector elements comparing long
string, although allocates additional memory...

Vector class implements Cloneable interface, so you can call clone().
Something like this:

Vector tmpPackages = TurbineResources.getVector("module.packages");
Vactor packages = (Vector) tmpPackages.clone();
packages.addElement( GenericLoader.getBasePackage() );


/ Shamil 




------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to