Commit Graph

58 Commits

Author SHA1 Message Date
Andrea Piseri
3fa971a510 Add the inner for loop back in the logic
This could be easier to predict in cases where one of `left` and `right`
is significantly greater than the other, and as such the same branch is
taken multiple times in a row
2022-12-21 22:10:02 +01:00
Andrea Piseri
191223bb3c Fix non-generic cast in core:slice.rotate_left 2022-12-21 21:58:01 +01:00
Andrea Piseri
385d2a143c Fix core:slice.rotate_left
This commit includes two fixes:
- a temporary cast to make the function compile
- a fix to a logic error that caused the function to hang or return
  incorrect results
2022-12-21 21:09:22 +01:00
André (counter)
7fbee88061 Fix typo err: runtime.Allocator to Allocator_Error 2022-12-09 19:20:03 +01:00
gingerBill
6dd4d1a924 Correct reflection usage of maps 2022-11-08 11:50:55 +00:00
gingerBill
075040ae05 Update sort_private.odin 2022-10-18 00:06:21 +01:00
gingerBill
c4d19dfa92 Use uint instead of int to improve code generation for bounds checking 2022-09-27 22:31:46 +01:00
gingerBill
c056a0d108 Add slice.enumerated_array 2022-09-22 00:52:37 +01:00
gingerBill
756c1b7bcb Correct slice/ptr.odin calls 2022-09-17 15:12:32 +01:00
Phil
7d55bfc120 fix sort_by_indices_allocate 2022-09-07 10:53:56 -07:00
Phil
3f3ae4b2b6 fix sort_by_with_indices for zero and one length slices: 2022-09-01 13:14:10 -07:00
Phil
63eec25044 add sort_by_indices overload and test 2022-09-01 12:32:33 -07:00
Phil
7a9b0731cf add tests for sort_by_indices 2022-09-01 12:13:15 -07:00
Phil
d45661c405 cleanup slice sorting with indices changes 2022-09-01 11:51:45 -07:00
Phil
002bec256a have sort_with_indices allocate. Add a couple convenience procs for using the indices result to sort other slices. 2022-09-01 11:46:59 -07:00
Phil
15aaf7dfa0 add sort_with_indices family of procs 2022-08-31 14:06:21 -07:00
gingerBill
2908923db9 Fix #1972 2022-08-24 12:18:42 +01:00
Jeroen van Rijn
9f413862e9 Add strings.prefix_length & slice.prefix_length 2022-06-16 12:34:13 +02:00
gingerBill
ff9d058392 Minor changes to core:slice/heap; add to examples/all 2022-06-12 17:25:42 +01:00
gingerBill
1acc8f438b Merge pull request #1830 from graphitemaster/dale/max_heap
add max heap implementation to slice package
2022-06-12 17:21:04 +01:00
Despacito696969
a343fb171d Fixed slice.is_sorted_cmp 2022-06-07 14:07:19 +02:00
Dale Weiler
a996cfc536 fix 2022-06-04 04:47:52 -04:00
Dale Weiler
c1d55b9296 add max heap implementation to slice package 2022-06-04 04:31:55 -04:00
gingerBill
fb49841b1d Remove strings dependency from core:sys/windows 2022-06-02 13:02:16 +01:00
Tetralux
7428e52264 Duplicate some basic slice procedures from core:mem into core:slice 2022-04-18 16:56:45 +00:00
Andrea Piseri
a040be957f Fix tail recursion in _quick_sort_general
The `if` statement should have been a `for` loop, in order to allow recursively
sorting the subarrays with quicksort, and not resort to shell sort after
one step.
2022-04-13 10:55:16 +02:00
gingerBill
29e660b16f Add more things to package slice
min_max
any_of(_proc)
none_of(_proc)
all_of(_proc)
count(_proc)
2022-03-08 10:02:40 +00:00
gingerBill
2f1aeaf757 Remove the unneeded $ 2022-01-31 15:56:40 +00:00
gingerBill
14a17fb36f Add slice.stable_sort* procedures 2022-01-31 15:55:52 +00:00
gingerBill
1a9ec776cb Unify logic for slice.sort* related procedures 2022-01-31 12:43:20 +00:00
Andrea Piseri
92e70b9a58 use multipointers instead of simple pointers 2021-12-28 16:22:34 +01:00
Andrea Piseri
822da9d12d Merge branch 'master' into slice_scanner 2021-12-28 16:12:15 +01:00
gingerBill
dbf42d2469 make slice.as_ptr return [^]E 2021-12-28 14:16:27 +00:00
Andrea Piseri
5d80e24224 Add slice/scanner proc 2021-12-23 12:49:40 +01:00
Tetralux
e2b36c4004 Rename slice.to_dynamic to slice.clone_to_dynamic 2021-12-21 02:17:24 +00:00
Michael Kutowski
4439d59105 add builtin. 2021-11-19 00:24:56 +01:00
gingerBill
9e754cb0f1 Add slice.swap_between 2021-10-26 20:22:39 +01:00
gingerBill
9331ebebcc Add #no_bounds_check to sorting procedures 2021-10-26 14:24:21 +01:00
gingerBill
344abf2cb2 Make core and vendor adhere to -vet, -strict-style, and -disallow-do 2021-09-11 16:40:19 +01:00
gingerBill
251da264ed Remove unneeded semicolons from the core library 2021-08-31 22:21:13 +01:00
gingerBill
f0437a4242 Enforce core:builtin and core:intrinsics for imports 2021-08-21 13:44:16 +01:00
gingerBill
6afc28f827 Use builtin.min and builtin.max in package slice 2021-07-09 15:33:25 +01:00
gingerBill
7acbf8b7b9 Add slice.min and add slice.max 2021-07-08 11:23:07 +01:00
gingerBill
1c76577918 Add slice.sort_by_cmp Ordering based sorting algorithms 2021-07-03 15:16:44 +01:00
gingerBill
3e7aabe6d8 Change uses for parapoly records to use $ always 2021-06-14 11:43:35 +01:00
gingerBill
d602709133 Fix typo 2021-04-14 12:14:44 +01:00
gingerBill
8e1120bc09 Fix typo 2021-04-13 19:23:12 +01:00
gingerBill
2b36069924 Fix typo 2021-04-12 17:13:05 +01:00
gingerBill
fc8c94324e Fix typo 2021-03-29 15:43:33 +01:00
gingerBill
fa09640e7e Fix slice.concatenate 2021-02-27 10:58:10 +00:00