Skip to content

Commit

Permalink
chore: not use i--
Browse files Browse the repository at this point in the history
  • Loading branch information
wiidede committed Jun 30, 2024
1 parent f027af2 commit 500f782
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Range.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ watch(model, (val) => {
sort(val)
}
else if (val.length < length) {
for (let i = length - 1; i >= val.length; i--) {
for (let i = length - 1; i >= val.length; i -= 1) {
const index = indexMapReversed.value[i]
delete indexMap.value[index]
}
Expand Down Expand Up @@ -174,7 +174,7 @@ function onUpdate(percentage: number) {
let index = indexMap.value[current.value]
const oldValue = values[index]
if (oldValue - value > 0 && index > 0) {
for (let i = index; i > 0; i--) {
for (let i = index; i > 0; i -= 1) {
const prev = values[i - 1]
if (value < prev) {
swap(modelValue, i, i - 1)
Expand Down

0 comments on commit 500f782

Please sign in to comment.