Commit Graph

60 Commits

Author SHA1 Message Date
Jeroen van Rijn
1242b6e82f Improve slice.binary_search_by 2024-08-10 18:26:59 +02:00
gingerBill
5413a8b744 Even more style fixes 2024-06-29 19:11:36 +01:00
gingerBill
3f9a58808c More style improvements 2024-06-29 19:07:34 +01:00
Sandro Cavazzoni
e41878a64f Fix slice.unique wrong result
When you try to make this array unique `[]int{1, 2, 4, 4, 5}` you get
`[]int{1, 4, 5}` instead of `[]int{1, 2, 4, 5}`.
Our index `i` should be increased even with both indices `i` and `j`
have the same value
2024-06-16 11:36:20 +02:00
Damian Tarnawski
8ba644dd79 Add #no_bounds_check to slice.equal 2024-06-14 19:45:54 +02:00
korvahkh
58ae96c821 Fix slice.has_prefix & slice.has_suffix
The needle was the element type instead of the slice type.
2024-05-25 15:52:35 -05:00
Jeroen van Rijn
8f706a14f8 Add allocator param. 2024-05-09 17:58:48 +02:00
Jeroen van Rijn
e5af98eabe Simplify bitset_to_enum_slice 2024-05-09 17:55:50 +02:00
Jeroen van Rijn
858c78b844 Pass new -vet-style check. 2024-05-09 17:47:19 +02:00
Jeroen van Rijn
a61d8daec1 Add make version of bitset to slice. 2024-05-09 17:44:39 +02:00
Jeroen van Rijn
7bcf3b1a0d Add slice.enum_slice_to_bitset & slice.bitset_to_enum_slice 2024-05-09 17:15:45 +02:00
Aaron Kavaler
ac634acd4b fixed slice.unique and slice.unique_proc 2024-03-13 19:19:31 -07:00
gingerBill
3e7e779abf Replace core:* to base:* where appropriate 2024-01-28 22:18:51 +00:00
gingerBill
173527d631 Remove random tag 2023-12-13 01:53:15 +00:00
gingerBill
f8cb2bcad2 Add slice.unique and slice.unique_proc 2023-12-13 01:50:26 +00:00
gingerBill
b011487778 Reimplement binary_search_by to be simpler 2023-12-13 01:37:15 +00:00
gingerBill
c8cc130744 Fix the implementation of binary_search_by to work with a normal ordering call, rather than the backwards version.
WHY THE HECK WAS IT THIS WAY IN THE FIRST PLACE?!
2023-12-13 01:24:03 +00:00
gingerBill
fe0244606b Revert 2023-12-13 01:20:53 +00:00
gingerBill
036fa6482c Use cmp_proc in binary_search 2023-12-13 01:18:05 +00:00
gingerBill
04ca22b9ea Add to core:slice reduce_reverse, filter_reverse, repeat 2023-12-13 00:35:23 +00:00
Matija Dizdar
843b2350eb added #no_bounds_check back into binary_search_by 2023-12-06 21:48:37 +01:00
Matija Dizdar
526d338300 removed incorrect requirement for key type to be ordered in binary_search_by 2023-12-06 21:29:18 +01:00
Tarık B
5a661dc67b Add min_index and max_index procedures 2023-11-26 08:33:50 +01:00
Hector
9f96382558 Removed some accidental semi-colons and converted indentation to tabs. 2023-11-25 16:36:51 +00:00
Hector
1db5e1250f Binary search improvements
Modified the algorithm so that the index is either the location of the
element if found or the index at which to insert the element to maintain
sorted order.

Also added some tests to verify the above claim.
2023-11-25 13:48:48 +00:00
Karl Zylinski
d2ac3c2228 Make slice.clone and slice.clone_to_dynamic take a loc parameter 2023-10-30 21:19:21 +01:00
gingerBill
d50a844720 Replace mem with runtime in core:slice 2023-06-28 11:04:51 +01:00
gingerBill
9371325246 Fix typo 2023-05-25 12:19:41 +01:00
gingerBill
600c97cc0f Add missing Allocator_Error and @(require_results) to many procedures 2023-05-22 11:34:38 +01:00
gingerBill
db8b2e69dd Fix slice.reverse 2023-01-27 11:12:10 +00: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
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
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
Tetralux
7428e52264 Duplicate some basic slice procedures from core:mem into core:slice 2022-04-18 16:56:45 +00: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
14a17fb36f Add slice.stable_sort* procedures 2022-01-31 15:55:52 +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
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