mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add string methods to json, and fix issue in dstring when the formatter uses temp. Remove unnecessary use of temp allocator in to_format for json.
This commit is contained in:
@@ -48,9 +48,9 @@ fn usz! Object.to_format(&self, Formatter* formatter) @dynamic
|
||||
return n;
|
||||
case ObjectInternalMap:
|
||||
usz n = formatter.printf("{")!;
|
||||
@pool()
|
||||
@stack_mem(1024; Allocator mem)
|
||||
{
|
||||
foreach (i, key : self.map.key_tlist())
|
||||
foreach (i, key : self.map.key_new_list(mem))
|
||||
{
|
||||
if (i > 0) n += formatter.printf(",")!;
|
||||
n += formatter.printf(`"%s":`, key)!;
|
||||
|
||||
Reference in New Issue
Block a user