more pr feedback

This commit is contained in:
Ari Lazier 2016-05-27 16:03:03 -07:00
parent 9fe636b614
commit 38c6eb7b6b
5 changed files with 6 additions and 6 deletions

View File

@ -248,7 +248,7 @@ inline typename T::Function RealmClass<T>::create_constructor(ContextType ctx) {
} }
static inline void convert_outdated_datetime_columns(const SharedRealm &realm) { static inline void convert_outdated_datetime_columns(const SharedRealm &realm) {
int old_file_format_version = realm->file_format_upgraded_from_version(); realm::util::Optional<int> old_file_format_version = realm->file_format_upgraded_from_version();
if (old_file_format_version && old_file_format_version < 5) { if (old_file_format_version && old_file_format_version < 5) {
// any versions earlier than file format 5 are stored as milliseconds and need to be converted to the new format // any versions earlier than file format 5 are stored as milliseconds and need to be converted to the new format
for (auto& object_schema : *realm->config().schema) { for (auto& object_schema : *realm->config().schema) {

View File

@ -463,10 +463,10 @@ void Realm::close()
m_coordinator = nullptr; m_coordinator = nullptr;
} }
int Realm::file_format_upgraded_from_version() const util::Optional<int> Realm::file_format_upgraded_from_version() const
{ {
if (upgrade_initial_version != upgrade_final_version) { if (upgrade_initial_version != upgrade_final_version) {
return upgrade_initial_version; return upgrade_initial_version;
} }
return 0; return util::Optional<int>();
} }

View File

@ -133,7 +133,7 @@ namespace realm {
void close(); void close();
// returns the file format version upgraded from, or 0 if not upgraded // returns the file format version upgraded from, or 0 if not upgraded
int file_format_upgraded_from_version() const; util::Optional<int> file_format_upgraded_from_version() const;
~Realm(); ~Realm();