mirror of
https://github.com/cwbaker/lalr.git
synced 2026-09-26 16:33:18 +03:00
Leave the RHS of a GrammarSymbolSet move default initialized
Previously the RHS was left as it was when, technically, it should be restored to its default initialized state. This fix exchanges the RHS GrammarSymbolSet values with their default initialized values to correct that error.
This commit is contained in:
parent
4e000f92ef
commit
5e01cd323e
1 changed files with 6 additions and 6 deletions
|
|
@ -20,23 +20,23 @@ static const size_t BITS_PER_ELEMENT = sizeof(size_t) * 8;
|
||||||
|
|
||||||
GrammarSymbolSet::GrammarSymbolSet( size_t symbols )
|
GrammarSymbolSet::GrammarSymbolSet( size_t symbols )
|
||||||
: set_()
|
: set_()
|
||||||
, minimum_(numeric_limits<size_t>::max())
|
, minimum_( numeric_limits<size_t>::max() )
|
||||||
, maximum_(numeric_limits<size_t>::min())
|
, maximum_( numeric_limits<size_t>::min() )
|
||||||
{
|
{
|
||||||
set_.resize( symbols / BITS_PER_ELEMENT );
|
set_.resize( symbols / BITS_PER_ELEMENT );
|
||||||
}
|
}
|
||||||
|
|
||||||
GrammarSymbolSet::GrammarSymbolSet( GrammarSymbolSet&& set )
|
GrammarSymbolSet::GrammarSymbolSet( GrammarSymbolSet&& set )
|
||||||
: set_( std::move(set.set_) )
|
: set_( std::move(set.set_) )
|
||||||
, minimum_(set.minimum_)
|
, minimum_( std::exchange(set.minimum_, numeric_limits<size_t>::max()) )
|
||||||
, maximum_(set.maximum_)
|
, maximum_( std::exchange(set.maximum_, numeric_limits<size_t>::min()) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GrammarSymbolSet::GrammarSymbolSet( const GrammarSymbolSet& set )
|
GrammarSymbolSet::GrammarSymbolSet( const GrammarSymbolSet& set )
|
||||||
: set_( set.set_ )
|
: set_( set.set_ )
|
||||||
, minimum_(set.minimum_)
|
, minimum_( set.minimum_ )
|
||||||
, maximum_(set.maximum_)
|
, maximum_( set.maximum_ )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue