aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-08 20:30:07 +0000
committertv <tv@krebsco.de>2026-11-08 21:33:04 +0100
commit54399ae3528deeeba5b09fc619394d2f2cd287f9 (patch)
tree5aeca24a84686e03276276408d03c44d1b7f7ba8 /src
parent31d25938a299fe16d9b1019998b5e5a68b9b7d78 (diff)
screen: move each change along instead of copying it
Screening copied every change it took, and every one left waiting for a signature, bytes and all, from the batch it had ordered and then dropped. Move them out of the batch instead; only a refused change, recorded with why, is still copied.
Diffstat (limited to 'src')
-rw-r--r--src/access/screen.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/access/screen.rs b/src/access/screen.rs
index 0ff7ff2..68e4db7 100644
--- a/src/access/screen.rs
+++ b/src/access/screen.rs
@@ -389,7 +389,7 @@ pub(crate) fn apply(
// The values their users sign, under a strict policy, as the document holds them:
// read again once the document takes the accepted (`reaches_signed`).
let mut signed: Option<Option<Vec<Vec<String>>>> = None;
- for (index, change) in ready.iter().enumerate() {
+ for (index, change) in ready.into_iter().enumerate() {
let hash = change.hash();
let committer = committers[index].as_deref();
let user = change.message().and_then(user_of).map(str::to_owned);
@@ -420,7 +420,7 @@ pub(crate) fn apply(
// whoever brought it, not by the node the actor is.
if signatures
.as_deref()
- .is_some_and(|signatures| signatures.forks(doc, change))
+ .is_some_and(|signatures| signatures.forks(doc, &change))
{
refused.insert(hash, hash);
forged.insert(hash);
@@ -442,7 +442,7 @@ pub(crate) fn apply(
|| change.deps().iter().any(|dep| unsigned.contains(dep))
{
unsigned.insert(hash);
- waiting.0.push(change.clone());
+ waiting.0.push(change);
continue;
}
// It makes a map where one accepted before may have: the rules read whether one
@@ -489,7 +489,7 @@ pub(crate) fn apply(
};
match judged {
Ok(()) => {
- accepted.push(change.clone());
+ accepted.push(change);
if let Some(committer) = committer {
screened.taken_from.insert(committer.to_owned());
}