aboutsummaryrefslogtreecommitdiff
path: root/core/strings
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2025-03-05 13:54:31 -0500
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2025-03-05 13:54:31 -0500
commitfef5f526f338a6029a2f9d94131f9fd7c4869937 (patch)
tree62ec592bacdeaa32aa2a3927c8667f0b1126f4d2 /core/strings
parent951bef4ade595e5fa7e8f0d0681e4e34ab1ca9d3 (diff)
Remove unneeded slicing in `strings.clone`
Diffstat (limited to 'core/strings')
-rw-r--r--core/strings/strings.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/strings/strings.odin b/core/strings/strings.odin
index e99a1bfb4..52230f572 100644
--- a/core/strings/strings.odin
+++ b/core/strings/strings.odin
@@ -25,7 +25,7 @@ Returns:
clone :: proc(s: string, allocator := context.allocator, loc := #caller_location) -> (res: string, err: mem.Allocator_Error) #optional_allocator_error {
c := make([]byte, len(s), allocator, loc) or_return
copy(c, s)
- return string(c[:len(s)]), nil
+ return string(c), nil
}
/*
Clones a string safely (returns early with an allocation error on failure)