From 302ef8cfa60d2d7c6236e1dd7821750e4e1e8a47 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 15 Jan 2024 20:20:20 +0100 Subject: cleaner i guess --- c_litems.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'c_litems.go') diff --git a/c_litems.go b/c_litems.go index 4aa21d6..86841ca 100644 --- a/c_litems.go +++ b/c_litems.go @@ -210,3 +210,12 @@ func (item *ItemsNode) get_next_level() *ItemsNode { } return nil } + +func (litems *ItemsList) reset_id() { + if litems.head != nil { + litems.head.ID = 1 + } + for ptr := litems.head; ptr != nil && ptr.next != nil; ptr = ptr.next { + ptr.next.ID = ptr.ID + 1 + } +} -- cgit v1.2.3