af83/chouette-core

View on GitHub
app/lib/enumerable_ext.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Enumerable
  # Returns true if all items are already sorted
  def sorted?
    each_cons(2).all? { |a, b| (a <=> b) <= 0 }
  end
end