From 06031271ddd4fcd7b4a3a89b6c277e95cb167052 Mon Sep 17 00:00:00 2001 From: Ksenia Tryapitsyna Date: Mon, 21 Oct 2024 16:38:46 +0300 Subject: [PATCH] fix: refactor code in points-utils --- src/utils/point-utils.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/point-utils.js b/src/utils/point-utils.js index 2153a81..550a130 100644 --- a/src/utils/point-utils.js +++ b/src/utils/point-utils.js @@ -27,16 +27,16 @@ const getPointDuration = (pointDateFrom, pointDateTo) => { return pointDuration.format('mm[M]'); }; -function getWeightForPrice(a, b) { - if (a.basePrice < b.basePrice) { +function getWeightForPrice(pointA, pointB) { + if (pointA.basePrice < pointB.basePrice) { return 1; } - if (a.basePrice > b.basePrice) { + if (pointA.basePrice > pointB.basePrice) { return -1; } - if (a.basePrice === b.basePrice) { + if (pointA.basePrice === pointB.basePrice) { return 0; } } @@ -58,16 +58,16 @@ function getWeightForTime(pointA, pointB) { } } -function getWeigthForDay(a, b) { - if (a.dateFrom > b.dateFrom) { +function getWeigthForDay(pointA, pointB) { + if (pointA.dateFrom > pointB.dateFrom) { return 1; } - if (a.dateFrom < b.dateFrom) { + if (pointA.dateFrom < pointB.dateFrom) { return -1; } - if (a.dateFrom === b.dateFrom) { + if (pointA.dateFrom === pointB.dateFrom) { return 0; } }