aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-06-05 15:43:15 +0100
committergingerBill <bill@gingerbill.org>2024-06-05 15:43:15 +0100
commitcbabcb0907e6430571c14d21fcb09c150275d99b (patch)
treecd1f5601d46eb4dee27d4c39973fda80a0104769 /src/types.cpp
parentc406bbb6e3c05118b97c3ee30d6a2efc4c4b870f (diff)
Fix #3682
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index e568d2af2..618e5bd8a 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -457,6 +457,15 @@ gb_internal Selection sub_selection(Selection const &sel, isize offset) {
return res;
}
+gb_internal Selection trim_selection(Selection const &sel) {
+ Selection res = {};
+ res.index.data = sel.index.data;
+ res.index.count = gb_max(sel.index.count - 1, 0);
+ res.index.capacity = res.index.count;
+ return res;
+}
+
+
gb_global Type basic_types[] = {
{Type_Basic, {Basic_Invalid, 0, 0, STR_LIT("invalid type")}},