mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 15:45:42 +08:00
refs #721 Avoid looking up the JSON object key twice every time.
This commit is contained in:
@@ -305,7 +305,8 @@ namespace BlackMisc
|
||||
auto meta = introspect<Derived>().without(MetaFlags<DisabledForJson>());
|
||||
meta.forEachMemberName(*derived(), [ & ](auto & member, const QString & name)
|
||||
{
|
||||
if (json.contains(name)) { json.value(name) >> member; }
|
||||
auto it = json.find(name);
|
||||
if (it != json.end()) { it.value() >> member; }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user