diff --git a/sources/Data/Collections/ArrayListIterator.uc b/sources/Data/Collections/ArrayListIterator.uc index 58452ff..7574bad 100644 --- a/sources/Data/Collections/ArrayListIterator.uc +++ b/sources/Data/Collections/ArrayListIterator.uc @@ -41,9 +41,10 @@ public function bool Initialize(Collection relevantArray) return true; } -public function LeaveOnlyNotNone() +public function Iter LeaveOnlyNotNone() { skipNoneReferences = true; + return self; } public function Iter Next(optional bool deprecated) diff --git a/sources/Data/Collections/HashTableIterator.uc b/sources/Data/Collections/HashTableIterator.uc index 2aba583..44ea74f 100644 --- a/sources/Data/Collections/HashTableIterator.uc +++ b/sources/Data/Collections/HashTableIterator.uc @@ -51,9 +51,10 @@ public function bool Initialize(Collection relevantArray) return true; } -public function LeaveOnlyNotNone() +public function Iter LeaveOnlyNotNone() { skipNoneReferences = true; + return self; } public function Iter Next(optional bool deprecated) diff --git a/sources/Data/Collections/Iter.uc b/sources/Data/Collections/Iter.uc index 7243eb4..d61286f 100644 --- a/sources/Data/Collections/Iter.uc +++ b/sources/Data/Collections/Iter.uc @@ -86,6 +86,13 @@ public function AcediaObject GetKey(); */ public function bool HasFinished(); +/** + * Makes caller iterator skip any `none` items during iteration. + * + * @return Reference to caller `Iterator` to allow for method chaining. + */ +public function Iter LeaveOnlyNotNone(); + defaultproperties { } \ No newline at end of file