mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
std.fmt: remove placeholders from binary
This commit is contained in:
parent
d4c85079c5
commit
34644511bb
@ -99,7 +99,8 @@ pub fn format(
|
||||
@setEvalBranchQuota(2000000);
|
||||
comptime var arg_state: ArgState = .{ .args_len = fields_info.len };
|
||||
comptime var i = 0;
|
||||
inline while (i < fmt.len) {
|
||||
comptime var literal: []const u8 = "";
|
||||
inline while (true) {
|
||||
const start_index = i;
|
||||
|
||||
inline while (i < fmt.len) : (i += 1) {
|
||||
@ -121,14 +122,17 @@ pub fn format(
|
||||
i += 2;
|
||||
}
|
||||
|
||||
// Write out the literal
|
||||
if (start_index != end_index) {
|
||||
try writer.writeAll(fmt[start_index..end_index]);
|
||||
}
|
||||
literal = literal ++ fmt[start_index..end_index];
|
||||
|
||||
// We've already skipped the other brace, restart the loop
|
||||
if (unescape_brace) continue;
|
||||
|
||||
// Write out the literal
|
||||
if (literal.len != 0) {
|
||||
try writer.writeAll(literal);
|
||||
literal = "";
|
||||
}
|
||||
|
||||
if (i >= fmt.len) break;
|
||||
|
||||
if (fmt[i] == '}') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user