mirror of
git://jb55.com/damus
synced 2024-09-19 11:43:44 +00:00
ndb: make note equatble
We need this for the switchover
This commit is contained in:
parent
45801f3e6c
commit
2053033b25
@ -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
|
// we can have owned notes, but we can also have lmdb virtual-memory mapped notes so its optional
|
||||||
private let owned: Bool
|
private let owned: Bool
|
||||||
let count: Int
|
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? {
|
static func owned_from_json(json: String, bufsize: Int = 2 << 18) -> NdbNote? {
|
||||||
return json.withCString { cstr in
|
return json.withCString { cstr in
|
||||||
return NdbNote.owned_from_json_cstr(
|
return NdbNote.owned_from_json_cstr(
|
||||||
|
Loading…
Reference in New Issue
Block a user