comparison src/share/vm/libadt/vectset.cpp @ 4051:f350490a45fd

7105611: Set::print() is broken Summary: Reimplemented class VSetI_ to restore Set::print(). Reviewed-by: never
author kvn
date Thu, 27 Oct 2011 18:20:50 -0700
parents 3763ca6579b7
children d2a62e0f25eb
comparison
equal deleted inserted replaced
4050:34535d2cb362 4051:f350490a45fd
346 uint32 _xor = 0; 346 uint32 _xor = 0;
347 uint lim = ((size<4)?size:4); 347 uint lim = ((size<4)?size:4);
348 for( uint i = 0; i < lim; i++ ) 348 for( uint i = 0; i < lim; i++ )
349 _xor ^= data[i]; 349 _xor ^= data[i];
350 return (int)_xor; 350 return (int)_xor;
351 }
352
353 //------------------------------iterate----------------------------------------
354 // Used by Set::print().
355 class VSetI_ : public SetI_ {
356 VectorSetI vsi;
357 public:
358 VSetI_( const VectorSet *vset, uint &elem ) : vsi(vset) { elem = vsi.elem; }
359
360 uint next(void) { ++vsi; return vsi.elem; }
361 int test(void) { return vsi.test(); }
362 };
363
364 SetI_ *VectorSet::iterate(uint &elem) const {
365 return new(ResourceObj::C_HEAP) VSetI_(this, elem);
351 } 366 }
352 367
353 //============================================================================= 368 //=============================================================================
354 //------------------------------next------------------------------------------- 369 //------------------------------next-------------------------------------------
355 // Find and return the next element of a vector set, or return garbage and 370 // Find and return the next element of a vector set, or return garbage and