Skip to content

Commit db0de6c

Browse files
committed
Changed algoUtils::swap() argument names.
1 parent a7b10f4 commit db0de6c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

SortAlgorithms.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ void algo::selectionSort(std::vector<Sortable>& sortElements, int timeSleep) {
1818
}
1919
}
2020

21-
void algoUtils::swap(std::vector<Sortable>& sortElements, int timeSleep, Sortable& num1, Sortable& num2) {
22-
num1.color = sf::Color::Red;
23-
num2.color = sf::Color::Red;
21+
void algoUtils::swap(std::vector<Sortable>& sortElements, int timeSleep, Sortable& el1, Sortable& el2) {
22+
el1.color = sf::Color::Red;
23+
el2.color = sf::Color::Red;
2424

2525
// Swap positions
26-
auto currElement = num1;
27-
auto tempElement = num2;
28-
num1 = tempElement;
29-
num2 = currElement;
26+
auto currElement = el1;
27+
auto tempElement = el2;
28+
el1 = tempElement;
29+
el2 = currElement;
3030

3131
// Wait timeSleep ms between iterations
3232
sf::sleep(sf::milliseconds(timeSleep));
3333

34-
num1.color = sf::Color::White;
35-
num2.color = sf::Color::White;
34+
el1.color = sf::Color::White;
35+
el2.color = sf::Color::White;
3636
}

SortAlgorithms.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ namespace algo {
88
}
99

1010
namespace algoUtils {
11-
void swap(std::vector<Sortable>& sortElements, int timeSleep, Sortable& num1, Sortable& num2);
11+
void swap(std::vector<Sortable>& sortElements, int timeSleep, Sortable& el1, Sortable& el2);
1212
}

0 commit comments

Comments
 (0)