Skip to content

Commit 8ea2191

Browse files
committed
database: avoid to copy EventId in Event::decode
Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 4ad2466 commit 8ea2191

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* pool: better checks before perform queries or send messages to relays ([Yuki Kishimoto])
3939
* pool: bump `async-wsocket` to `v0.6` ([Yuki Kishimoto])
4040
* database: not match event if `Filter::search` field is set ([Yuki Kishimoto])
41+
* database: avoid to copy `EventId` in `Event::decode` ([Yuki Kishimoto])
4142
* sdk: rename `Proxy` and `ProxyTarget` to `Connection` and `ConnectionTarget` ([Yuki Kishimoto])
4243
* sqlite: use `ValueRef` instead of owned one ([Yuki Kishimoto])
4344
* cli: improve `sync` command ([Yuki Kishimoto])

crates/nostr-database/src/flatbuffers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl FlatBufferDecode for Event {
113113
.collect::<Result<Vec<Tag>, _>>()?;
114114

115115
Ok(Self::new(
116-
EventId::from_slice(&ev.id().ok_or(Error::NotFound)?.0)?,
116+
EventId::owned(ev.id().ok_or(Error::NotFound)?.0),
117117
PublicKey::from_slice(&ev.pubkey().ok_or(Error::NotFound)?.0)?,
118118
Timestamp::from(ev.created_at()),
119119
Kind::from(ev.kind() as u16),

0 commit comments

Comments
 (0)