Files
ShadowsocksX-NG/Legacy/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift
T
Qiu Yuzhou 3a62f473bc chore: restructure repo for modern reimplementation
- Remove GitHub Actions workflows and issue templates
- Move legacy ShadowsocksX-NG project into Legacy/
- Remove git submodules; dependencies will use prebuilt
  binaries copied from upstream releases instead of
  building in-repo
- Add ShadowsocksX-NG2/ directory for the new project
- Update .gitignore paths for the new layout
2026-09-19 22:31:37 +08:00

24 lines
589 B
Swift

//
// InfiniteSequence.swift
// Platform
//
// Created by Krunoslav Zaher on 6/13/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
/// Sequence that repeats `repeatedValue` infinite number of times.
struct InfiniteSequence<Element> : Sequence {
typealias Iterator = AnyIterator<Element>
private let repeatedValue: Element
init(repeatedValue: Element) {
self.repeatedValue = repeatedValue
}
func makeIterator() -> Iterator {
let repeatedValue = self.repeatedValue
return AnyIterator { repeatedValue }
}
}