| ... | ... | @@ -99,7 +99,8 @@ pub fn format( |
| 99 | 99 | @setEvalBranchQuota(2000000); |
| 100 | 100 | comptime var arg_state: ArgState = .{ .args_len = fields_info.len }; |
| 101 | 101 | comptime var i = 0; |
| 102 | | inline while (i < fmt.len) { |
| 102 | comptime var literal: []const u8 = ""; |
| 103 | inline while (true) { |
| 103 | 104 | const start_index = i; |
| 104 | 105 | |
| 105 | 106 | inline while (i < fmt.len) : (i += 1) { |
| ... | ... | @@ -121,14 +122,17 @@ pub fn format( |
| 121 | 122 | i += 2; |
| 122 | 123 | } |
| 123 | 124 | |
| 124 | | // Write out the literal |
| 125 | | if (start_index != end_index) { |
| 126 | | try writer.writeAll(fmt[start_index..end_index]); |
| 127 | | } |
| 125 | literal = literal ++ fmt[start_index..end_index]; |
| 128 | 126 | |
| 129 | 127 | // We've already skipped the other brace, restart the loop |
| 130 | 128 | if (unescape_brace) continue; |
| 131 | 129 | |
| 130 | // Write out the literal |
| 131 | if (literal.len != 0) { |
| 132 | try writer.writeAll(literal); |
| 133 | literal = ""; |
| 134 | } |
| 135 | |
| 132 | 136 | if (i >= fmt.len) break; |
| 133 | 137 | |
| 134 | 138 | if (fmt[i] == '}') { |