diff --git a/Sucrose.podspec b/Sucrose.podspec index 4bd3515..aff9080 100644 --- a/Sucrose.podspec +++ b/Sucrose.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.swift_version = "5.0" s.name = "Sucrose" - s.version = "3.3.0" + s.version = "3.3.1" s.summary = "🍬 Everyday sugar" s.description = "Collection of handy methods & objects" diff --git a/Sucrose/Extensions/Collection+SafeIndex.swift b/Sucrose/Extensions/Collection+SafeIndex.swift index 6876824..a1cd97c 100644 --- a/Sucrose/Extensions/Collection+SafeIndex.swift +++ b/Sucrose/Extensions/Collection+SafeIndex.swift @@ -11,6 +11,6 @@ import Foundation public extension Collection { subscript(safe index: Index) -> Element? { - return indices.contains(index) ? self[index] : nil + return index < endIndex && index >= startIndex ? self[index] : nil } }