From 6f306755d5b7503d2fb6fb88aecbcc5534babdf7 Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Sun, 29 Jun 2014 14:18:33 +0800 Subject: [PATCH] Minor adjustment to simpledom example Showing the type Value and preventing member lookup twice. --- example/simpledom/simpledom.cpp | 3 ++- readme.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/example/simpledom/simpledom.cpp b/example/simpledom/simpledom.cpp index 56be032..de2dc66 100644 --- a/example/simpledom/simpledom.cpp +++ b/example/simpledom/simpledom.cpp @@ -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; diff --git a/readme.md b/readme.md index 00c83af..e07321b 100644 --- a/readme.md +++ b/readme.md @@ -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;