You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::shared_ptr
SHAMap::snapShot (bool isMutable) const
{
auto ret = std::make_shared (type_, f_, get_version());
SHAMap& newMap = *ret;
if (!isMutable)
newMap.state_ = SHAMapState::Immutable;
newMap.seq_ = seq_ + 1;
newMap.ledgerSeq_ = ledgerSeq_;
newMap.root_ = root_;
newMap.backed_ = backed_;
**if ((state_ != SHAMapState::Immutable) || !isMutable)**
{
// If either map may change, they cannot share nodes
newMap.unshare ();
}
return ret;
}
In the above codes, this line "if ((state_ != SHAMapState::Immutable) || !isMutable)" ,
it seems that it should be "if ((state_ != SHAMapState::Immutable) || isMutable)"
The text was updated successfully, but these errors were encountered:
The code does look wrong. I think it's not hurting us because I don't believe the code ever tries to take a mutable snapshot of a ledger that isn't already unshared. But I suspect it would be possible to create a unit test that fails with the current code and works correctly with this fixed.
std::shared_ptr
SHAMap::snapShot (bool isMutable) const
{
auto ret = std::make_shared (type_, f_, get_version());
SHAMap& newMap = *ret;
}
In the above codes, this line "if ((state_ != SHAMapState::Immutable) || !isMutable)" ,
it seems that it should be "if ((state_ != SHAMapState::Immutable) || isMutable)"
The text was updated successfully, but these errors were encountered: