mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-24 01:17:34 +00:00
perf: Remove unnecessary clones for PDU size check
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -534,7 +534,7 @@ impl Service {
|
||||
return state;
|
||||
},
|
||||
};
|
||||
if !pdu_fits(&value.clone()) {
|
||||
if !pdu_fits(&value) {
|
||||
warn!(
|
||||
"dropping incoming PDU {event_id} in room {room_id} from room join \
|
||||
because it exceeds 65535 bytes or is otherwise too large."
|
||||
|
||||
@@ -330,7 +330,7 @@ impl super::Service {
|
||||
pdu_json
|
||||
.insert("event_id".into(), CanonicalJsonValue::String(pdu.event_id.clone().into()));
|
||||
// Verify that the *full* PDU isn't over 64KiB.
|
||||
if !pdu_fits(&pdu_json.clone()) {
|
||||
if !pdu_fits(&pdu_json) {
|
||||
// feckin huge PDU mate
|
||||
return Err!(Request(TooLarge("Message/PDU is too long (exceeds 65536 bytes)")));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user