Implement strings the way Go itself does

This makes string slicing cheap.
This commit is contained in:
Ayke van Laethem
2018-04-14 19:24:21 +02:00
parent 7cc2301621
commit 60a01a43a3
3 changed files with 10 additions and 15 deletions
+2 -2
View File
@@ -6,8 +6,8 @@
#define print(buf, len) write(STDOUT_FILENO, buf, len)
void __go_printstring(string_t *str) {
write(STDOUT_FILENO, str->buf, str->len);
void __go_printstring(string_t str) {
write(STDOUT_FILENO, str.buf, str.len);
}
void __go_printint(intgo_t n) {