class Bundler::CompactIndexClient::Cache

def parse_version_checksum(line, checksums)

This method gets called at least once for every gem when parsing versions.
This is mostly the same as `split(" ", 3)` but it avoids allocating extra objects.
def parse_version_checksum(line, checksums)
  line.freeze # allows slicing into the string to not allocate a copy of the line
  name_end = line.index(" ")
  checksum_start = line.index(" ", name_end + 1) + 1
  checksum_end = line.size - checksum_start
  # freeze name since it is used as a hash key
  # pre-freezing means a frozen copy isn't created
  name = line[0, name_end].freeze
  checksum = line[checksum_start, checksum_end]
  checksums[name] = checksum
end