perf: remove totally redundant and highly allocating .to_lowercase() calls from search endpoints

This commit is contained in:
Riz Ashraf committed 2026-09-21 15:33:35 +01:00
1 parent 9476bcd649
commit f8d98a77fd
3 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -146,7 +146,7 @@ impl McpTool for SearchSnippetsHandler {
async fn execute(&self, args: Value, state: Arc<MemoryState>) -> Result<String, String> {
let req: SearchSnippetsTool = serde_json::from_value(args).map_err(|e| e.to_string())?;
let query = req.query.to_lowercase();
let query = req.query;
let data = state.snippets.read_with(|snippets| {
let results: Vec<_> = snippets.iter().filter(|s| {
contains_ignore_ascii_case(&s.name, &query)