Convert all uses of *_from_slice to *_from_bytes where appropriate

This commit is contained in:
gingerBill
2022-05-16 01:43:43 +01:00
parent e10105a780
commit 33895b6d92
11 changed files with 31 additions and 26 deletions
+3 -2
View File
@@ -124,11 +124,11 @@ reset_builder :: proc(b: ^Builder) {
used in `fmt.bprint*`
bytes: [8]byte // <-- gets filled
builder := strings.builder_from_slice(bytes[:])
builder := strings.builder_from_bytes(bytes[:])
strings.write_byte(&builder, 'a') -> "a"
strings.write_byte(&builder, 'b') -> "ab"
*/
builder_from_slice :: proc(backing: []byte) -> Builder {
builder_from_bytes :: proc(backing: []byte) -> Builder {
s := transmute(mem.Raw_Slice)backing
d := mem.Raw_Dynamic_Array{
data = s.data,
@@ -140,6 +140,7 @@ builder_from_slice :: proc(backing: []byte) -> Builder {
buf = transmute([dynamic]byte)d,
}
}
builder_from_slice :: builder_from_bytes
// cast the builder byte buffer to a string and return it
to_string :: proc(b: Builder) -> string {