diff options
Diffstat (limited to 'src/VideoList.hx')
| -rw-r--r-- | src/VideoList.hx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/VideoList.hx b/src/VideoList.hx index eb3e67d..852c5e5 100644 --- a/src/VideoList.hx +++ b/src/VideoList.hx @@ -52,13 +52,12 @@ class VideoList { return items.exists(f); } + public function find(f:(item:VideoItem) -> Bool):Null<VideoItem> { + return items.find(f); + } + public function findIndex(f:(item:VideoItem) -> Bool):Int { - var i = 0; - for (v in items) { - if (f(v)) return i; - i++; - } - return -1; + return items.findIndex(f); } public function addItem(item:VideoItem, atEnd:Bool):Void { |
