perf: to_channel shares one Arc<str> across all broadcast recipients instead of cloning the line per member (server-time members share a single time-tagged variant); single-recipient sends unchanged
This commit is contained in:
parent
fc58113db9
commit
cf2b157842
3 changed files with 103 additions and 19 deletions
|
|
@ -129,7 +129,7 @@ impl Server {
|
|||
out.send(format!(
|
||||
"SERVER {} {} {} :{}",
|
||||
self.name, pass, self.sid, self.server_desc
|
||||
));
|
||||
).into());
|
||||
sent_server = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -150,7 +150,7 @@ impl Server {
|
|||
|
||||
fn link_out(&self, uid: Uid, line: String) {
|
||||
if let Some(l) = self.links.get(&uid) {
|
||||
l.out.send(line);
|
||||
l.out.send(line.into());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue