Minor adjustment to simpledom example

Showing the type Value and preventing member lookup twice.
This commit is contained in:
Milo Yip 2014-06-29 14:18:33 +08:00
parent 8a959c3898
commit 6f306755d5
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -68,7 +68,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;