Skip to content

Commit 093dc55

Browse files
authored
Merge branch 'master' into master
2 parents 77a7ddf + 58fb84f commit 093dc55

9 files changed

Lines changed: 206 additions & 244 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
zig-cache/
22
build_runner.zig
3+
__pycache__/

C++/Morwenn's rewrite of Summer Dragonfly's GrailSort/grailsort.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ namespace grailsort_detail
133133
}
134134

135135
template<typename RandomAccessIterator, typename Compare, typename T>
136-
static int BinarySearchLeft(RandomAccessIterator array, int start, int length, const T& target, Compare comp) {
136+
static int BinarySearchLeft(RandomAccessIterator array, int start, int length, T&& target, Compare comp) {
137137
int left = 0;
138138
int right = length;
139139

@@ -153,7 +153,7 @@ namespace grailsort_detail
153153

154154
// Credit to Anonymous0726 for debugging
155155
template<typename RandomAccessIterator, typename Compare, typename T>
156-
static int BinarySearchRight(RandomAccessIterator array, int start, int length, const T& target, Compare comp) {
156+
static int BinarySearchRight(RandomAccessIterator array, int start, int length, T&& target, Compare comp) {
157157
int left = 0;
158158
int right = length;
159159

@@ -283,7 +283,10 @@ namespace grailsort_detail
283283
}
284284

285285
if(buffer != left) {
286-
std::swap_ranges(buffer, buffer + (middle - left), left);
286+
while (left != middle) {
287+
std::iter_swap(buffer, left);
288+
++buffer; ++left;
289+
}
287290
}
288291
}
289292

@@ -985,7 +988,7 @@ namespace grailsort_detail
985988

986989
template<typename RandomAccessIterator, typename BufferIterator, typename Compare>
987990
void CombineOutOfPlace(RandomAccessIterator array, int firstKey, int start, int length, int subarrayLen, int blockLen,
988-
int mergeCount, int lastSubarrays, BufferIterator extBuffer, int extBufferLen, Compare comp) {
991+
int mergeCount, int lastSubarrays, BufferIterator extBuffer, Compare comp) {
989992
std::move(array + (start - blockLen), array + start, extBuffer);
990993

991994
int fullMerge = 2 * subarrayLen;
@@ -1070,7 +1073,7 @@ namespace grailsort_detail
10701073
// block fits into our external buffer.
10711074
if(buffer && blockLen <= extBufferLen) {
10721075
CombineOutOfPlace(array, firstKey, start, length, subarrayLen, blockLen, mergeCount, lastSubarrays,
1073-
extBuffer, extBufferLen, comp);
1076+
extBuffer, comp);
10741077
}
10751078
else {
10761079
CombineInPlace(array, firstKey, start, length, subarrayLen, blockLen,
@@ -1186,8 +1189,8 @@ namespace grailsort_detail
11861189
return;
11871190
}
11881191

1189-
BufferIterator extBuffer;
1190-
int extBufferLen;
1192+
BufferIterator extBuffer{};
1193+
int extBufferLen = 0;
11911194

11921195
int blockLen = 1;
11931196

Python/thatsOven's Rewritten Grailsort for Python/GrailSort.py renamed to Python/Amari Calipso's Rewritten Grailsort for Python/GrailSort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def arrayCopy(fromArray, fromIndex, toArray, toIndex, length): # thanks to Bee
3434
# The Holy Grail Sort Project
3535
# Project Manager: Summer Dragonfly
3636
# Project Contributors: 666666t
37+
# Amari Calipso
3738
# Anonymous0726
3839
# aphitorite
3940
# Control
@@ -47,7 +48,6 @@ def arrayCopy(fromArray, fromIndex, toArray, toIndex, length): # thanks to Bee
4748
# MP
4849
# phoenixbound
4950
# Spex_guy
50-
# thatsOven
5151
# _fluffyy
5252
#
5353
#
@@ -60,7 +60,7 @@ def arrayCopy(fromArray, fromIndex, toArray, toIndex, length): # thanks to Bee
6060
#
6161
# ** Written and maintained by The Holy Grail Sort Project
6262
#
63-
# Primary author: thatsOven
63+
# Primary author: Amari Calipso
6464
#
6565
# Current status: Working (Passing all tests) + Stable
6666

Python/DeveloperSort's Tester for Python/tester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
#
4444
# Editor : DeveloperSort
4545

46-
# importing Python\thatsOven's Rewritten Grailsort for Python\GrailSort.py
46+
# importing Python\Amari Calipso's Rewritten Grailsort for Python\GrailSort.py
4747
# i know, it looks messy.
4848
import sys
4949
originalPath = sys.path[0]
50-
sys.path[0] += "\\..\\thatsOven's Rewritten Grailsort for Python\\"
50+
sys.path[0] += "\\..\\Amari Calipso's Rewritten Grailsort for Python\\"
5151
import GrailSort
5252
sys.path[0] = originalPath
5353

Binary file not shown.
Binary file not shown.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ A diverse array of heavily refactored versions of Andrey Astrelin's GrailSort.h,
77
# Current implementations featured in our repo:
88
* Summer Dragonfly et al.'s Rewritten Grailsort for **Java** (ALL TESTS PASSING / POTENTIALLY FIXED)
99
* 666666t's Rewritten Grailsort for **Rust**
10-
* thatsOven's Rewritten Grailsort for **Python**
10+
* Amari Calipso's Rewritten Grailsort for **Python**
1111
* Enver's Rewritten Grailsort for **JavaScript**
1212
* Summer Dragonfly's *Simple* Rewritten Grailsort for **C**
1313
* Morwenn's adaptation of Summer Dragonfly's Java Rewritten Grailsort for **C++**
1414
* \_fluffyy's Rewritten Grailsort for **Python**
1515
* Gaming32's Rewritten Grailsort for **Cython**
1616
* SpexGuy's Rewritten Grailsort for **Zig**
1717
* AceOfSpadesProduc100's Rewritten Grailsort for **C#**
18+
* Amari Calipso's Rewritten Grailsort for **V**
1819
* *more to come!*
1920

2021
# What is Grailsort?
@@ -62,6 +63,7 @@ Now, there *are* some glaring flaws with Grailsort, but they're now easier than
6263
* Summer Dragonfly / MusicTheorist
6364
* Project Contributors:
6465
* 666666t
66+
* Amari Calipso
6567
* Anonymous0726
6668
* aphitorite
6769
* Control
@@ -74,7 +76,6 @@ Now, there *are* some glaring flaws with Grailsort, but they're now easier than
7476
* MP
7577
* phoenixbound
7678
* Spex_guy
77-
* thatsOven
7879
* \_fluffyy
7980
* AceOfSpadesProduc100
8081
* Special thanks to "The Studio" Discord community!

0 commit comments

Comments
 (0)