7105611: Set::print() is broken
Reimplemented class VSetI_ to restore Set::print(). Reviewed-by: never
This commit is contained in:
parent
5a2f55d0e0
commit
762ad9c51c
@ -350,6 +350,21 @@ int VectorSet::hash() const
|
|||||||
return (int)_xor;
|
return (int)_xor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------iterate----------------------------------------
|
||||||
|
// Used by Set::print().
|
||||||
|
class VSetI_ : public SetI_ {
|
||||||
|
VectorSetI vsi;
|
||||||
|
public:
|
||||||
|
VSetI_( const VectorSet *vset, uint &elem ) : vsi(vset) { elem = vsi.elem; }
|
||||||
|
|
||||||
|
uint next(void) { ++vsi; return vsi.elem; }
|
||||||
|
int test(void) { return vsi.test(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
SetI_ *VectorSet::iterate(uint &elem) const {
|
||||||
|
return new(ResourceObj::C_HEAP) VSetI_(this, elem);
|
||||||
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//------------------------------next-------------------------------------------
|
//------------------------------next-------------------------------------------
|
||||||
// Find and return the next element of a vector set, or return garbage and
|
// Find and return the next element of a vector set, or return garbage and
|
||||||
|
@ -151,7 +151,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SetI_ *iterate(uint&) const { ShouldNotCallThis(); return NULL; } // Removed
|
SetI_ *iterate(uint&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------Iteration--------------------------------------
|
//------------------------------Iteration--------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user