From 6133eebf8bb13caf0fec80b3c6322d1753b706b9 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 4 Sep 2015 11:30:00 -0700 Subject: [PATCH] Reduce the scope of a variable --- shared_realm.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared_realm.cpp b/shared_realm.cpp index 68972e4d..93e1aa13 100644 --- a/shared_realm.cpp +++ b/shared_realm.cpp @@ -355,8 +355,7 @@ bool Realm::refresh() uint64_t Realm::get_schema_version(const realm::Realm::Config &config) { - auto existing_realm = s_global_cache.get_any_realm(config.path); - if (existing_realm) { + if (auto existing_realm = s_global_cache.get_any_realm(config.path)) { return existing_realm->config().schema_version; }