1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00

ndb: make note equatble

We need this for the switchover
This commit is contained in:
William Casarin 2023-07-24 13:09:27 -07:00
parent 45801f3e6c
commit 2053033b25

View File

@ -34,7 +34,7 @@ enum NdbData {
}
}
class NdbNote {
class NdbNote: Equatable {
// we can have owned notes, but we can also have lmdb virtual-memory mapped notes so its optional
private let owned: Bool
let count: Int
@ -94,6 +94,10 @@ class NdbNote {
}
}
static func == (lhs: NdbNote, rhs: NdbNote) -> Bool {
return lhs.id == rhs.id
}
static func owned_from_json(json: String, bufsize: Int = 2 << 18) -> NdbNote? {
return json.withCString { cstr in
return NdbNote.owned_from_json_cstr(