mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
17 lines
271 B
Ruby
17 lines
271 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "tsort"
|
|
|
|
module Cask
|
|
# Topologically sortable hash map.
|
|
class TopologicalHash < Hash
|
|
include TSort
|
|
|
|
alias tsort_each_node each_key
|
|
|
|
def tsort_each_child(node, &block)
|
|
fetch(node).each(&block)
|
|
end
|
|
end
|
|
end
|