Commit 6f306755 authored by Milo Yip's avatar Milo Yip

Minor adjustment to simpledom example

Showing the type Value and preventing member lookup twice.
parent 8a959c38
...@@ -15,7 +15,8 @@ int main() { ...@@ -15,7 +15,8 @@ int main() {
d.Parse<0>(json); d.Parse<0>(json);
// 2. Modify it by DOM. // 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 // 3. Stringify the DOM
StringBuffer buffer; StringBuffer buffer;
......
...@@ -68,7 +68,8 @@ int main() { ...@@ -68,7 +68,8 @@ int main() {
d.Parse<0>(json); d.Parse<0>(json);
// 2. Modify it by DOM. // 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 // 3. Stringify the DOM
StringBuffer buffer; StringBuffer buffer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment