From b76d8a88aecda1c504c0caa5a2f51b4667e8a9eb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 24 Jul 2023 11:14:01 -0700 Subject: [PATCH] net/art: document return value of strideTable.delete Updates #7781 Signed-off-by: David Anderson --- net/art/stride_table.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/art/stride_table.go b/net/art/stride_table.go index 37eb5d4e1..79f607c77 100644 --- a/net/art/stride_table.go +++ b/net/art/stride_table.go @@ -175,7 +175,9 @@ func (t *strideTable[T]) insert(addr uint8, prefixLen int, val *T) { return } -// delete removes the route addr/prefixLen from t. +// delete removes the route addr/prefixLen from t. Returns the value +// that was associated with the deleted prefix, or nil if the prefix +// wasn't in the strideTable. func (t *strideTable[T]) delete(addr uint8, prefixLen int) *T { idx := prefixIndex(addr, prefixLen) recordedIdx := t.entries[idx].prefixIndex