Commit Graph
138 Commits
Author SHA1 Message Date
Ruan ad8cfbeb73 Fix slice.simple_equal misbehaviour on empty slice with non-nil data
Before this change, the following code:

```odin
package strconcat

import "core:fmt"
import "core:slice"

main :: proc() {
	a: [1]u8
	s1: []u8 = {}
	s2: []u8 = a[:0]

	fmt.printfln("s1={} len(s1)={} raw_data(s1)={}", s1, len(s1), raw_data(s1))
	fmt.printfln("s2={} len(s2)={} raw_data(s2)={}", s2, len(s2), raw_data(s2))
	fmt.printfln("equal(s1, s2):        {}", slice.equal(s1, s2))
	fmt.printfln("simple_equal(s1, s2): {}", slice.simple_equal(s1, s2))
}
```

Produced the following output on my machine:

```
s1=[] len(s1)=0 raw_data(s1)=<nil>
s2=[] len(s2)=0 raw_data(s2)=0x7FFFED64F74F
equal(s1, s2):        true
simple_equal(s1, s2): false
```

This commit fixes simple_equal's behaviour to match that of equal.
2026-08-17 22:38:40 +02:00
pav 2c7b3e6780 fix slice.get doing unnecessary bounds check 2026-08-17 18:40:12 +02:00
TheRadischen 7d9367e3b4 morestyle improvements mybe this is it? 2026-08-16 15:24:55 +02:00
TheRadischen 0b0778f981 morestyle improvements mybe this is it? 2026-08-16 15:24:19 +02:00
TheRadischen 1a70315797 style_corrections 2026-08-16 15:09:12 +02:00
TheRadischen 9757fed9f9 changed_to_tabs 2026-08-16 14:28:38 +02:00
TheRadischen d8177f7716 adjusted_smallsort_threshhold 2026-08-16 13:33:32 +02:00
TheRadischen 4c945c995a added_back_where 2026-08-16 12:58:23 +02:00
TheRadischen df54692a9b addedtest 2026-08-16 12:22:25 +02:00
TheRadischen 267c745ac7 rotate_merge 2026-08-16 12:07:09 +02:00
TheRadischen f41b57f1cc fixed type in slice.rotate
sry bll,
i swear im never programming tired again
2026-06-12 21:48:41 +02:00
TheRadischen 639196f28d Update slice.odin
added a check for rotate_left

rotating with 0 length array crashes
2026-06-03 22:33:49 +02:00
jakubtomsu d492122bd4 import cleanup 2026-02-09 20:08:22 +01:00
Jeroen van Rijn 533079fc1a Fix #6123 2026-01-24 11:13:50 +01:00
Laytan Laats 24ee35af28 nbio: add package 2026-01-11 20:21:25 +01:00
Laytan Laats 6c663b7a71 slice: fix examples 2026-01-11 20:21:25 +01:00
DarathDev f1e29fadab Add missing 'caller_location' to several procedures in 'slice' package 2025-12-28 15:05:59 -07:00
gingerBill ab9a05ed2d Remove contextless from slice.swap_with_slice 2025-12-11 14:54:03 +00:00
gingerBill 23c6d5dccb Add "contextless" where possible in core:slice 2025-12-11 14:49:55 +00:00
Jeroen van Rijn f70454c237 Merge pull request #5884 from NicknEma/patch-1
Improve docs for stable sort procedures
2025-11-04 18:08:50 +01:00
NicknEma eb2630a93c Improve docs for stable sort procedures
Explain what "stable" means and add an example
2025-11-04 14:32:39 +01:00
gingerBill 842cfee0f3 Change Odin's LICENSE to zlib from BSD 3-clause
This change was made in order to allow things produced with Odin and using Odin's core library, to not require the LICENSE to also be distributed alongside the binary form.
2025-10-28 14:38:25 +00:00
Jeroen van Rijn 7a9ea3ee6d Further overhaul of package line comments. 2025-10-09 23:05:29 +02:00
Jeroen van Rijn 2bc409eab5 More package lines. 2025-10-09 20:40:13 +02:00
gingerBill a7b6ab92c1 Remove unused store 2025-10-09 11:32:25 +01:00
gingerBill 10259ee665 Minor rename of a procedure 2025-10-08 12:35:14 +01:00
gingerBill 13b8607cc3 Add _internal_sort_from_indices_permuation 2025-10-07 14:15:40 +01:00
gingerBill af8c698b97 use ctx 2025-10-07 13:24:13 +01:00
gingerBill 9e068c254b Fix typos 2025-10-07 13:22:15 +01:00
gingerBill 85e37f2f7e Add missing nil 2025-10-07 13:18:30 +01:00
gingerBill b90c806386 Remove context._internal usage 2025-10-07 12:42:50 +01:00
gingerBill f40fc2792f Replace normal sort procedure with a simpler unified type-erased one 2025-10-07 12:38:01 +01:00
FourteenBrush 5811525592 Add slice.suffix_length 2025-07-03 16:51:38 +02:00
Laytan Laats 22ab8935c4 slice: use card in bitset_to_enum_slice_with_make
Fixes #4870
2025-02-24 21:10:12 +01:00
Giuliano Macedo 6785a485e3 docs: improved reinterpret docstring 2024-12-14 10:10:06 -03:00
Bazzagibbs cb0c1663b7 Add core:slice.size to get the byte size of a slice's backing data 2024-11-11 14:04:59 +11:00
Jeroen van Rijn eba7be34e7 Add slice.to_type 2024-10-01 23:27:15 +02:00
Laytan 38fedf2631 Merge pull request #4304 from kawaii-Code/linear_search_reverse
Add linear_search_reverse and linear_search_reverse_proc
2024-09-29 21:18:49 +02:00
Nia 253edb51f7 Fix markup in linear_search and binary_search docs 2024-09-29 17:08:54 +03:00
Nia 3c80f15a7a Remove pointless #no_bounds_check 2024-09-29 15:51:30 +03:00
Nia 3337d6b264 Add linear_search_reverse and linear_search_reverse_proc 2024-09-25 16:41:55 +03:00
Antonino Simone Di Stefano 5bced00f5d Return Allocator_Error in map_entry_infos 2024-09-22 23:25:46 +02:00
Antonino Simone Di Stefano baf5a06fba Remove address operator, which lead to a type error 2024-09-22 23:16:59 +02:00
Antonino Simone Di Stefano 355f84d0cd Use package qualifier for type_info_base and Type_Info_map 2024-09-21 00:30:50 +02:00
Karl Zylinski 19f0127e55 Moved all packages in core, base, vendor, tests and examples to use new #+ file tag syntax. 2024-09-14 18:27:49 +02:00
Feoramund 806c87d71d Check for zero-length slices in slice.equal 2024-09-03 02:48:26 -04:00
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