runtime: avoid an allocation in (*time.Timer).Reset

This commit is contained in:
Elias Naur
2025-05-09 15:52:48 +02:00
committed by Ron Evans
parent 2da9d26e21
commit 180662f038
6 changed files with 25 additions and 25 deletions
+3 -3
View File
@@ -117,11 +117,11 @@ func addTimer(tim *timerNode) {
// removeTimer is the implementation of time.stopTimer. It removes a timer from
// the timer queue, returning true if the timer is present in the timer queue.
func removeTimer(tim *timer) bool {
func removeTimer(tim *timer) *timerNode {
mask := interrupt.Disable()
removedTimer := timerQueueRemove(tim)
n := timerQueueRemove(tim)
interrupt.Restore(mask)
return removedTimer
return n
}
func schedulerRunQueue() *task.Queue {