reduce allocations at subscription.GetID() because why not.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package nostr
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"unsafe"
|
||||
|
||||
@@ -92,3 +94,8 @@ func arePointerValuesEqual[V comparable](a *V, b *V) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func subIdToSerial(subId string) int64 {
|
||||
serialId, _ := strconv.ParseInt(subId[0:strings.Index(subId, ":")], 10, 64)
|
||||
return serialId
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user