Petits tweaks

This commit is contained in:
Timothée Leclaire-Fournier 2024-01-29 18:10:53 -05:00
parent 69461a3f6f
commit a4764cd225
2 changed files with 7 additions and 6 deletions

View File

@ -326,7 +326,6 @@ void GOLTeamH::randomize(double percentAlive)
//! \return true si le patron est valide, false sinon.
//!
// TODO
bool GOLTeamH::setFromPattern(std::string const& pattern, int centerX, int centerY)
{
auto sq = parsePattern(pattern);
@ -556,6 +555,8 @@ std::optional<GOLTeamH::sizeQueried> GOLTeamH::parsePattern(std::string const& p
{
// Analyse du pattern
size_t pos{}, processedNumbers{};
if (pattern.size() < 6)
return std::nullopt;
// Vérification du '[' initial
if (pattern[pos++] != '[') {

View File

@ -59,11 +59,11 @@ GridTeamH& GridTeamH::operator=(GridTeamH&& mv) noexcept
if (this != &mv) {
dealloc();
mAliveCount = std::move(mv.mAliveCount);
mWidth = std::move(mv.mWidth);
mHeight = std::move(mv.mHeight);
mData = std::move(mv.mData);
mIntermediateData = std::move(mv.mIntermediateData);
mAliveCount = mv.mAliveCount;
mWidth = mv.mWidth;
mHeight = mv.mHeight;
mData = mv.mData;
mIntermediateData = mv.mIntermediateData;
// Il faut que le destructeur de l'ancien objet soit valide.
mv.mData = nullptr;