diff options
Diffstat (limited to 'Library/Homebrew/os')
| -rw-r--r-- | Library/Homebrew/os/mac/version.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Library/Homebrew/os/mac/version.rb b/Library/Homebrew/os/mac/version.rb index cfe42a75f..e19ecae70 100644 --- a/Library/Homebrew/os/mac/version.rb +++ b/Library/Homebrew/os/mac/version.rb @@ -16,9 +16,16 @@ module OS new(SYMBOLS.fetch(sym)) end + def initialize(*args) + super + @comparison_cache = {} + end + def <=>(other) - v = SYMBOLS.fetch(other, other.to_s) - super(Version.new(v)) + @comparison_cache.fetch(other) do + v = SYMBOLS.fetch(other, other.to_s) + @comparison_cache[other] = super(Version.new(v)) + end end def to_sym |
