Remove bufpool references and unused imports, optimize memory operations.
- Removed `bufpool` usage throughout `tag`, `tags`, and `event` packages for memory efficiency. - Replaced in-place buffer modifications with independent, deep-copied allocations to prevent unintended mutations. - Added new `Clone` method for deep copying `event.E`. - Ensured valid JSON emission for nil `Tags` in `event` marshaling. - Introduced `cmd/stresstest` for relay stress-testing with detailed workload generation and query simulation.
This commit is contained in:
@@ -94,7 +94,10 @@ func UnmarshalQuoted(b []byte) (content, rem []byte, err error) {
|
||||
if !escaping {
|
||||
rem = rem[1:]
|
||||
content = content[:contentLen]
|
||||
content = NostrUnescape(content)
|
||||
// Create a copy of the content to avoid corrupting the original input buffer
|
||||
contentCopy := make([]byte, len(content))
|
||||
copy(contentCopy, content)
|
||||
content = NostrUnescape(contentCopy)
|
||||
return
|
||||
}
|
||||
contentLen++
|
||||
|
||||
Reference in New Issue
Block a user