Skip to content

Commit 434c630

Browse files
authored
Typo
1 parent 933c489 commit 434c630

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tutorial07_answer/tutorial07_answer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static void lept_stringify_string(lept_context* c, const char* s, size_t len) {
142142
}
143143
~~~
144144

145-
要注意的是,很多优化都是有代优的。第一个优化采取空间换时间的策略,对于只含一个字符串的JSON,很可能会分配多 6 倍内存;但对于正常含多个值的 JSON,多分配的内存可在之后的值所利用,不会造成太多浪费。
145+
要注意的是,很多优化都是有代价的。第一个优化采取空间换时间的策略,对于只含一个字符串的JSON,很可能会分配多 6 倍内存;但对于正常含多个值的 JSON,多分配的内存可在之后的值所利用,不会造成太多浪费。
146146

147147
而第二个优化的缺点,就是有稍增加了一点程序体积。也许有人会问,为什么 `hex_digits` 不用字符串字面量 `"0123456789ABCDEF"`?其实是可以的,但这会多浪费 1 个字节(实际因数据对齐可能会浪费 4 个或更多)。
148148

0 commit comments

Comments
 (0)