Skip to content

Commit cf8b376

Browse files
Lazily load set
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.
1 parent c2eeae2 commit cf8b376

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rake/thread_pool.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
require "set"
32

43
require "rake/promise"
54

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

0 commit comments

Comments
 (0)