ZIm/crates/util/src
greathongtu e65471c7a1
Optimize JSON merging by removing redundant key clones in serde_json operations (#25866)
Hi Zed team! 👋
As a fan of Zed Editor who's excited to contribute, I noticed a small
optimization opportunity in the JSON merging utilities.

<b>Changes:</b>
Removed redundant key.clone() calls in insert() operations within 2
functions:
1. merge_json_value_into
2. merge_non_null_json_value_into

<b>Why:</b>
Since we're already moving ownership of `source_object` 's contents and
key is no longer used further, we could directly pass `key` to `insert`
without cloning.
Eliminates redundant allocations, improving performance slightly for
JSON-heavy operations.

<b>Testing:</b>
I have tested this locally and all existing tests passed. The change
preserves behavior while removing redundancy.

Love using Zed and happy to contribute! Let me know if any adjustments
are needed!

Release Notes:

- N/A
2025-03-01 14:13:38 -05:00
..
test Fix Clippy warnings in util crate (#8721) 2024-03-02 13:06:35 -05:00
arc_cow.rs Rust 1.85 (#25272) 2025-02-28 18:33:35 +01:00
command.rs windows: Set CREATE_NO_WINDOW for commands (#18447) 2024-11-20 16:52:38 -08:00
fs.rs chore: Clean up util dependencies. (#9247) 2024-03-13 00:10:49 +01:00
markdown.rs Display keymap errors on initial load (#23394) 2025-01-21 07:14:46 +00:00
paths.rs windows: Bring back restoration of tabs (#25870) 2025-03-01 17:18:34 +00:00
serde.rs Allow ignoring soft wraps when moving to line ends (#11153) 2024-05-02 12:30:45 +03:00
test.rs Canonicalize paths when running tests (#23655) 2025-01-26 14:56:07 +08:00
util.rs Optimize JSON merging by removing redundant key clones in serde_json operations (#25866) 2025-03-01 14:13:38 -05:00