Skip to content

Commit

Permalink
Lazily load set
Browse files Browse the repository at this point in the history
This file seems required by `rake` by default. By lazily loading `set`,
usages of `rake` that don't use this part of `rake`, don't unnecessarily
activate the `set` gem.

This seems really minor, I know. But when testing rubygems & bundler,
it's interesting for us to be in full control of the gems that are
loaded, to make sure that we don't unintentionally activate gems causing
our users to be unable to select the version of those gems that they
need.
  • Loading branch information
deivid-rodriguez committed Feb 3, 2021
1 parent c2eeae2 commit cf8b376
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rake/thread_pool.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
require "set"

require "rake/promise"

Expand All @@ -10,6 +9,7 @@ class ThreadPool # :nodoc: all
# Creates a ThreadPool object. The +thread_count+ parameter is the size
# of the pool.
def initialize(thread_count)
require "set"
@max_active_threads = [thread_count, 0].max
@threads = Set.new
@threads_mon = Monitor.new
Expand Down

0 comments on commit cf8b376

Please sign in to comment.