Browse Source

Add LeaveOnlyNotNone() method in the parent class

pull/8/head
Anton Tarasenko 2 years ago
parent
commit
fbe3e5073a
  1. 3
      sources/Data/Collections/ArrayListIterator.uc
  2. 3
      sources/Data/Collections/HashTableIterator.uc
  3. 7
      sources/Data/Collections/Iter.uc

3
sources/Data/Collections/ArrayListIterator.uc

@ -41,9 +41,10 @@ public function bool Initialize(Collection relevantArray)
return true; return true;
} }
public function LeaveOnlyNotNone() public function Iter LeaveOnlyNotNone()
{ {
skipNoneReferences = true; skipNoneReferences = true;
return self;
} }
public function Iter Next(optional bool deprecated) public function Iter Next(optional bool deprecated)

3
sources/Data/Collections/HashTableIterator.uc

@ -51,9 +51,10 @@ public function bool Initialize(Collection relevantArray)
return true; return true;
} }
public function LeaveOnlyNotNone() public function Iter LeaveOnlyNotNone()
{ {
skipNoneReferences = true; skipNoneReferences = true;
return self;
} }
public function Iter Next(optional bool deprecated) public function Iter Next(optional bool deprecated)

7
sources/Data/Collections/Iter.uc

@ -86,6 +86,13 @@ public function AcediaObject GetKey();
*/ */
public function bool HasFinished(); 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 defaultproperties
{ {
} }
Loading…
Cancel
Save