diff --git a/GPA675Lab1GOL/GOLTeamH.cpp b/GPA675Lab1GOL/GOLTeamH.cpp index 4c31c64..269cc48 100644 --- a/GPA675Lab1GOL/GOLTeamH.cpp +++ b/GPA675Lab1GOL/GOLTeamH.cpp @@ -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::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++] != '[') { diff --git a/GPA675Lab1GOL/GridTeamH.cpp b/GPA675Lab1GOL/GridTeamH.cpp index 4a125e7..4d2ddf6 100644 --- a/GPA675Lab1GOL/GridTeamH.cpp +++ b/GPA675Lab1GOL/GridTeamH.cpp @@ -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;