mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
The precondition in Bond::getOtherAtomIdx() is redundant (#9092)
This commit is contained in:
committed by
GitHub
parent
36f061efb1
commit
813cd85ecc
@@ -78,15 +78,14 @@ void Bond::setOwningMol(ROMol *other) {
|
||||
}
|
||||
|
||||
unsigned int Bond::getOtherAtomIdx(const unsigned int thisIdx) const {
|
||||
PRECONDITION(d_beginAtomIdx == thisIdx || d_endAtomIdx == thisIdx,
|
||||
"bad index");
|
||||
if (d_beginAtomIdx == thisIdx) {
|
||||
return d_endAtomIdx;
|
||||
} else if (d_endAtomIdx == thisIdx) {
|
||||
return d_beginAtomIdx;
|
||||
}
|
||||
// we cannot actually get down here
|
||||
return 0;
|
||||
// This "precondition" would check exactly the same that is checked
|
||||
// above, but no need to be redundant, so just throw.
|
||||
POSTCONDITION(false, "bad index");
|
||||
}
|
||||
|
||||
void Bond::setBeginAtomIdx(unsigned int what) {
|
||||
|
||||
Reference in New Issue
Block a user