Skip to content

Instantly share code, notes, and snippets.

Letanyan Arumugam Letanyan

Block or report user

Report or block Letanyan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Letanyan
Letanyan / OffsetBenchmarks.swift
Last active Apr 16, 2019
Benchmarking the performance of various ways to access a collection using an offset
View OffsetBenchmarks.swift
import Dispatch
extension BidirectionalCollection {
subscript(offset o: Int) -> Element {
if o < 0 {
return self[index(endIndex, offsetBy: o)]
} else {
return self[index(startIndex, offsetBy: o)]
}
}
You can’t perform that action at this time.