You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is incorrect as Date is a complex type, which cannot simply be memcpy-ed.
What you should do instead is something like this:
extensionDate:DataConvertible{publicinit?(data:Data){
guard let timeInterval =TimeInterval(data: data)else{returnnil}self=Date(timeIntervalSinceReferenceDate: timeInterval)}publicvardata:Data{returnself.timeIntervalSinceReferenceDate.data
}}
The text was updated successfully, but these errors were encountered:
regexident
changed the title
SwiftLMDB does not handle binary representation of Date properly
Implementation of DataConvertible for Date is incorrect
Sep 9, 2017
The way
DataConvertible
is implemented forDate
in SwiftLMDB right now is this:which then effectively ends up implementing this for each:
This is incorrect as
Date
is a complex type, which cannot simply bememcpy
-ed.What you should do instead is something like this:
The text was updated successfully, but these errors were encountered: