Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
nicola-cab committed Jul 12, 2024
1 parent 8830dca commit 2f1210b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/realm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1243,8 +1243,6 @@ RLM_API uint64_t realm_get_schema_version(const realm_t* realm);

/**
* Get the schema version for this realm at the path.
*
* This function cannot fail.
*/
RLM_API uint64_t realm_get_persisted_schema_version(const realm_config_t* config);

Expand Down
10 changes: 4 additions & 6 deletions src/realm/object-store/c_api/schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ RLM_API uint64_t realm_get_persisted_schema_version(const realm_config_t* config
conf.force_sync_history = true;
}

return wrap_err([&]() {
auto realm = new shared_realm{Realm::get_shared_realm(conf)};
uint64_t version = ObjectStore::get_schema_version(realm->get()->read_group());
delete realm;
auto realm = new shared_realm{Realm::get_shared_realm(conf)};
uint64_t version = ObjectStore::get_schema_version(realm->get()->read_group());
delete realm;

return version;
});
return version;
}

RLM_API bool realm_schema_validate(const realm_schema_t* schema, uint64_t validation_mode)
Expand Down

0 comments on commit 2f1210b

Please sign in to comment.