asdsadasdas
authorMax <Infinity2573@gmail.com>
Mon, 19 Sep 2022 22:33:54 +0000 (01:33 +0300)
committerMax <Infinity2573@gmail.com>
Mon, 19 Sep 2022 22:33:54 +0000 (01:33 +0300)
src/dssptools.cpp

index 54e0e6483577c6785305197951a91cacf4ef6e78..1b9aec648790a424245e656333a2805d654dbc37 100644 (file)
@@ -145,21 +145,19 @@ bool secondaryStructures::hasHBondBetween(std::size_t Donor, std::size_t Accepto
 }
 
 bool secondaryStructures::NoChainBreaksBetween(std::size_t Resi1, std::size_t Resi2) const{
-    bool flag{true};
     std::size_t i{Resi1}, j{Resi2}; // From i to j → i <= j
     if ( i > j ){
         std::swap(i, j);
     }
 
     for (; i != j; ++i){
-        flag = !(SecondaryStructuresStatusMap[i].isBreakPartnerWith(&SecondaryStructuresStatusMap[i + 1]) && SecondaryStructuresStatusMap[i + 1].isBreakPartnerWith(&SecondaryStructuresStatusMap[i]));
-    }
+        if ( !(SecondaryStructuresStatusMap[i].isBreakPartnerWith(&SecondaryStructuresStatusMap[i + 1]) && SecondaryStructuresStatusMap[i + 1].isBreakPartnerWith(&SecondaryStructuresStatusMap[i])) ){
 
-    if (!flag){
+        }
         std::cout << "Patternsearch has detected a CHAINBREAK between " << Resi1 << " and " << Resi2 << std::endl;
+        return false;
     }
-
-    return flag;
+    return true;
 }
 
 bridgeTypes secondaryStructures::calculateBridge(std::size_t i, std::size_t j) const{