Skip to content
This repository has been archived by the owner on Mar 29, 2018. It is now read-only.

Commit

Permalink
Merged fix for #8, rewrote lastIndexOf
Browse files Browse the repository at this point in the history
  • Loading branch information
pNre committed Jun 16, 2014
1 parent acde600 commit 7907bbe
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ExSwift/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ extension Array {
return found
}

return nil;
return nil
}

return nil
Expand All @@ -147,12 +147,8 @@ extension Array {
*/
func lastIndexOf <U: Equatable> (item: U) -> Int? {
if item is Element {
for (index, obj) in enumerate(self.reverse()) {
if let object = obj as? U {
if item == object {
return count - index - 1
}
}
if let index = reverse().indexOf(item) {
return count - index - 1
}

return nil
Expand Down

0 comments on commit 7907bbe

Please sign in to comment.