mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-22 08:02:11 +02:00
Minor adjustment to simpledom example
Showing the type Value and preventing member lookup twice.
This commit is contained in:
@@ -15,7 +15,8 @@ int main() {
|
||||
d.Parse<0>(json);
|
||||
|
||||
// 2. Modify it by DOM.
|
||||
d["stars"].SetInt(d["stars"].GetInt() + 1);
|
||||
Value& s = d["stars"];
|
||||
s.SetInt(s.GetInt() + 1);
|
||||
|
||||
// 3. Stringify the DOM
|
||||
StringBuffer buffer;
|
||||
|
Reference in New Issue
Block a user