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 fc97025
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 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
2 changes: 0 additions & 2 deletions test/object-store/c_api/c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5890,8 +5890,6 @@ TEST_CASE("C API - async_open", "[sync][pbs][c_api]") {
realm_t* realm = realm_from_thread_safe_reference(userdata.realm_ref, nullptr);
realm_release(userdata.realm_ref);

REQUIRE(realm_get_persisted_schema_version(config) == 0);

bool found;
realm_class_info_t class_info;
realm_find_class(realm, "object", &found, &class_info);
Expand Down

0 comments on commit fc97025

Please sign in to comment.