Capistrano server definition
Capistrano is a server automation and deployment tool written in Ruby. It provides a Ruby DSL for defining deployments and other operations on a set of servers, and executing those flows.
A Capistrano environment defines a number of servers, each of which has zero or more "roles", which help define which of your rules should be executed on them. Servers are distinguished by their hostname and ssh ports; Two servers with the same hostname and ssh port are considered to be the same server.
Capistrano allows you to define servers using either the role helper, which attaches a role to a server (defining the server if needed), or the more explicit server method. If you define multiple roles on the same server (as in this example in the docs):
role :app, %w{example.com} role :web, %w{example.com} role :db, %w{example.com}
Then Capistrano identifies that those servers are the same server, and merges the roles into a single Server:
[10] pry(main)> Capistrano::Configuration.env.servers => #<Capistrano::Configuration::Servers:0x00000001763eb8 @servers= [#<Capistrano::Configuration::Server:0x00000001763c88 @hostname="example.com", @keys=[], @local=false, @port=nil, @properties=#<Capistrano::Configuration::Server::Properties:0x00000001763940 @properties={}, @roles=#<Set: {:db, :app, :web}>>, @user=nil>]>
However, until recently, this merging and deduplication was performed by walking the list of all registered servers, comparing hostname and port. Obviously, this meant that each new server definition had to scan all previous servers, for a classic O(n²) bug.
The patch resolved the issue in the obvious way, by storing servers in a hash keyed by the (hostname, port) pair.
Thanks to Daniel Benamy for finding, fixing, and bringing this one to my attention.

