[PR #3097] [MERGED] Effect panels: borrow the name and reuse the icon key #4800

Closed
opened 2026-11-03 05:08:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3097
Author: @Domanffe
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: perf/effect-panel-strings


📝 Commits (1)

  • f7bb1ce Effect panels: borrow the name and reuse the icon key

📊 Changes

1 file changed (+11 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/inventory_effects.rs (+11 -4)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

paint runs over the active effect panels every frame the inventory is open.
For each panel it cloned the name when the label fit, and built
format!("mob_effect/{id}") for the icon lookup.

The name is a Cow now: borrowed when it fits, owned only when it is clipped,
and the icon key is built in one String outside the loop. The strings handed
to the batch are the same.

cargo clippy -p horizon-client --all-targets -- -D warnings → clean. No
benchmark isolates the inventory screen; the change stands on the copies it
removes per panel per frame.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3097 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/effect-panel-strings` --- ### 📝 Commits (1) - [`f7bb1ce`](https://github.com/horizon-rust/horizon/commit/f7bb1ceb79249b380813f5cd2743a83f83ec76f6) Effect panels: borrow the name and reuse the icon key ### 📊 Changes **1 file changed** (+11 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/inventory_effects.rs` (+11 -4) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. `paint` runs over the active effect panels every frame the inventory is open. For each panel it cloned the name when the label fit, and built `format!("mob_effect/{id}")` for the icon lookup. The name is a `Cow` now: borrowed when it fits, owned only when it is clipped, and the icon key is built in one `String` outside the loop. The strings handed to the batch are the same. `cargo clippy -p horizon-client --all-targets -- -D warnings` → clean. No benchmark isolates the inventory screen; the change stands on the copies it removes per panel per frame. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:03 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4800
No description provided.