Minor adjustment to simpledom example
Showing the type Value and preventing member lookup twice.
This commit is contained in:
parent
8a959c3898
commit
6f306755d5
@ -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() {
|
|||||||
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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user