             if let k = self.indices.dropLast().lastOf({ self[$0] < self[$0.successor()] }) {
                 let range = k.successor()..<self.endIndex
                 swap(&_self[k], &_self[range.lastOf { self[k] < self[$0] }!])
-                _self[range].reverseInPlace()
+                _self.reverseInPlace(range)
             } else {
                 _self.reverseInPlace()
             }


public extension MutableCollectionType where Index : BidirectionalIndexType {
    
    mutating func reverseInPlace() {
        var temp: Index?
        for (lhs, rhs) in zip(self.indices, self.indices.reverse()) {
            if lhs != rhs && temp != rhs {
                swap(&self[lhs], &self[rhs])
                temp = lhs

            }
        }
    }
    
    mutating func reverseInPlace() {
        self.reverseInPlace(self.indices)
    }
}

public extension MutableCollectionType where Index : BidirectionalIndexType, Generator.Element : Comparable {
