Skip to content

Commit

Permalink
Tweaked implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
peterb180369 committed Feb 19, 2019
1 parent ce8ca37 commit 850b6ee
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions BXSwiftUtils/Collections/Mirror+IterateProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,18 @@ public extension Mirror

for child in mirror.children
{
if let property = child.value as? T
{
closure(property)
}

if let array = child.value as? [T]
{
array.forEach { closure($0) }
}

if let dictionary = child.value as? [AnyHashable:T]
else if let dictionary = child.value as? [AnyHashable:T]
{
dictionary.values.forEach { closure($0) }
}
else if let property = child.value as? T
{
closure(property)
}

if recursive
{
Expand Down

0 comments on commit 850b6ee

Please sign in to comment.