Skip to content

Commit

Permalink
#4508 - Refactor (Phosphate.ts): Change the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriiP-EPAM committed May 8, 2024
1 parent 4914a23 commit 75404a0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/ketcher-core/src/domain/entities/Phosphate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,14 @@ export class Phosphate extends BaseMonomer {

public get isPartOfRna(): boolean {
// To avoid endless looping when checking `monomerForR2`,
// we take into account that we did not return to checking `initialPhosphate`.
// we take into account that we did not return to checking the initial phosphate (`this`).
const checkIfPhosphateIsPartOfRNA = (phosphate: Phosphate): boolean => {
const { R1: polymerBond1, R2: polymerBond2 } =
phosphate.attachmentPointsToBonds;
const monomerForR1 = polymerBond1?.getAnotherMonomer(phosphate);
const monomerForR2 = polymerBond2?.getAnotherMonomer(phosphate);
const isMonomerForR1SugarAndPartOfRNA =
monomerForR1 instanceof Sugar && (monomerForR1 as Sugar).isPartOfRna;
// `this` — the initial phosphate.
if (monomerForR2 === this) {
return isMonomerForR1SugarAndPartOfRNA;
}
Expand Down

0 comments on commit 75404a0

Please sign in to comment.