-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Useless assigns #6055
Useless assigns #6055
Changes from 4 commits
f61a137
d955b02
ebd3918
2dd1be9
5e88918
265f6f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -328,10 +328,7 @@ class RedBlackTreeRunner | |
def initialize(n = 10_000) | ||
@n = n | ||
|
||
random = Random.new(1234) # repeatable random seq | ||
@a1 = Array(Int32).new(n) { rand(99_999) } | ||
|
||
random = Random.new(4321) # repeatable random seq | ||
@a2 = Array(Int32).new(n) { rand(99_999) } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this code instead be fixed to do what it was intended to do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should, but not as a part of this PR. |
||
|
||
@tree = RedBlackTree.new | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,4 @@ OptionParser.parse! do |opts| | |
end | ||
end | ||
|
||
in_filenames = ARGV | ||
|
||
do_work ARGV, output_filename, ignore_case |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,15 +204,11 @@ body.each_line do |line| | |
end | ||
|
||
downcase_ranges = case_ranges entries, &.downcase | ||
downcase_one_ranges, downcase_ranges = downcase_ranges.partition { |r| r.delta == 1 } | ||
downcase_one_ranges, _ = downcase_ranges.partition { |r| r.delta == 1 } | ||
|
||
upcase_ranges = case_ranges entries, &.upcase | ||
upcase_ranges.select! { |r| r.delta != -1 } | ||
|
||
alternate_ranges = alternate_ranges(downcase_one_ranges) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is used in the ECR template. That's why the tool doesn't see it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! I knew I was missing something there... |
||
|
||
casefold_ranges = case_ranges entries, &.casefold | ||
|
||
all_strides = {} of String => Array(Stride) | ||
categories = %w(Lu Ll Lt Mn Mc Me Nd Nl No Zs Zl Zp Cc Cf Cs Co Cn) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ end | |
def assert_normalize(from, to, flags = nil) | ||
program = Program.new | ||
program.flags = flags if flags | ||
normalizer = Normalizer.new(program) | ||
# normalizer = Normalizer.new(program) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this not removed? |
||
from_nodes = Parser.parse(from) | ||
to_nodes = program.normalize(from_nodes) | ||
to_nodes.to_s.strip.should eq(to.strip) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ describe "concurrent" do | |
|
||
it "re-raises errors from Fibers as ConcurrentExecutionException" do | ||
exception = expect_raises(ConcurrentExecutionException) do | ||
a, b = parallel(raising_job, raising_job) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not useless per-se. It does matter that the return type is a tuple. But it is tested in the following spec. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, this spec is not good then. |
||
parallel(raising_job, raising_job) | ||
end | ||
|
||
exception.cause.should be_a(SomeParallelJobException) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not so repeatable huh