From 009a6e397651a9540b6c6bb74ef2230eeda9b577 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 17 Aug 2025 03:09:52 +0800 Subject: Some mass renaming --- forged/internal/misc/iter.go | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 forged/internal/misc/iter.go (limited to 'forged/internal/misc/iter.go') diff --git a/forged/internal/misc/iter.go b/forged/internal/misc/iter.go deleted file mode 100644 index 61a96f4..0000000 --- a/forged/internal/misc/iter.go +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-only -// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu - -package misc - -import "iter" - -// iterSeqLimit returns an iterator equivalent to the supplied one, but stops -// after n iterations. -func IterSeqLimit[T any](s iter.Seq[T], n uint) iter.Seq[T] { - return func(yield func(T) bool) { - var iterations uint - for v := range s { - if iterations > n-1 { - return - } - if !yield(v) { - return - } - iterations++ - } - } -} -- cgit v1.2.3