Parcourir la source

Merge pull request #5041 from mtarik34b/remove-redundant-code-in-string-justify

Remove redundant `builder_init()` calls from `strings.left_justify()` and `strings.right_justify()`
Laytan il y a 4 mois
Parent
commit
09c8477bd3
1 fichiers modifiés avec 0 ajouts et 2 suppressions
  1. 0 2
      core/strings/strings.odin

+ 0 - 2
core/strings/strings.odin

@@ -3044,7 +3044,6 @@ left_justify :: proc(str: string, length: int, pad: string, allocator := context
 	pad_len := rune_count(pad)
 
 	b: Builder
-	builder_init(&b, allocator)
 	builder_init(&b, 0, len(str) + (remains/pad_len + 1)*len(pad), allocator) or_return
 
 	w := to_writer(&b)
@@ -3079,7 +3078,6 @@ right_justify :: proc(str: string, length: int, pad: string, allocator := contex
 	pad_len := rune_count(pad)
 
 	b: Builder
-	builder_init(&b, allocator)
 	builder_init(&b, 0, len(str) + (remains/pad_len + 1)*len(pad), allocator) or_return
 
 	w := to_writer(&b)