Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit6ba9b645e3bd14912da90d3d9f2eb8e2df58a009 (patch)
Author
 Hristo Partenov <146854527+ico12319@users.noreply.github.com>
2024-10-20 23:18:16 +0300
Committer
 GitHub <noreply@github.com>
2024-10-20 23:18:16 +0300
Files3748840aa05ad871a356fb792f447b1cde000822
Data-structures-and-algorithms-6ba9b645e3bd14912da90d3d9f2eb8e2df58a009.tar
Data-structures-and-algorithms-6ba9b645e3bd14912da90d3d9f2eb8e2df58a009.tar.gz
Data-structures-and-algorithms-6ba9b645e3bd14912da90d3d9f2eb8e2df58a009.zip
Parentaedbe92bc75a1e2b569448b5ece0f81091f7af6b (diff)
remove redundant copying
1 files changed, 1 insertions, 6 deletions
-rw-r--r--Seminar02/src/sorting-algorithms/merge-sort.cpp7
diff --git a/Seminar02/src/sorting-algorithms/merge-sort.cpp b/Seminar02/src/sorting-algorithms/merge-sort.cpp
index 3ae3c09..16d7d4b 100644
--- a/Seminar02/src/sorting-algorithms/merge-sort.cpp
+++ b/Seminar02/src/sorting-algorithms/merge-sort.cpp
@@ -35,11 +35,6 @@ void merge(T* firstArray, unsigned firstSize,
{
buffer[resultIter++] = secondArray[secondIter++];
}
-
- for (size_t i = 0; i < firstSize + secondSize; i++)
- {
- firstArray[i] = buffer[i];
- }
}
@@ -84,4 +79,4 @@ int main()
mergeSort(numbers.data(), numbers.size());
std::cout << std::is_sorted(numbers.begin(), numbers.end()) << std::endl;
-} \ No newline at end of file
+}