Skip to content

Commit

Permalink
Remove unnecessary casts
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed May 27, 2024
1 parent 0e95535 commit 634972d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions lib/ruby_indexer/lib/ruby_indexer/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,10 @@ def resolve_method(method_name, receiver_name)
return unless owner_entries && method_entries

owner_name = T.must(owner_entries.first).name
T.cast(
method_entries.grep(Entry::Member).select do |entry|
T.cast(entry, Entry::Member).owner&.name == owner_name
end,
T::Array[Entry::Member],
)

method_entries.grep(Entry::Member).select do |entry|
entry.owner&.name == owner_name
end
end

private
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/prism
Submodule prism updated 62 files
+0 −9 .github/workflows/documentation.yml
+0 −9 .github/workflows/github-pages.yml
+0 −1 .gitignore
+4 −0 CONTRIBUTING.md
+1 −0 Steepfile
+31 −0 bin/prism
+7 −25 config.yml
+0 −57 doc/images/rust.svg
+4 −8 doc/index.css
+0 −4 doc/index.html
+372 −107 ext/prism/extension.c
+13 −13 gemfiles/typecheck/Gemfile.lock
+11 −0 include/prism.h
+21 −0 include/prism/node.h
+25 −23 include/prism/parser.h
+2 −3 include/prism/static_literals.h
+2 −1 include/prism/util/pm_char.h
+8 −0 include/prism/util/pm_constant_pool.h
+9 −16 include/prism/util/pm_integer.h
+8 −0 include/prism/util/pm_string.h
+2 −0 lib/prism.rb
+249 −0 lib/prism/debug.rb
+1 −1 lib/prism/ffi.rb
+1 −13 lib/prism/node_ext.rb
+27 −12 lib/prism/translation/parser/compiler.rb
+6 −8 lib/prism/translation/ripper.rb
+2 −15 lib/prism/translation/ruby_parser.rb
+1 −0 prism.gemspec
+1 −0 rakelib/typecheck.rake
+0 −6 rbi/prism.rbi
+621 −390 src/prism.c
+84 −63 src/static_literals.c
+8 −0 src/util/pm_constant_pool.c
+10 −38 src/util/pm_integer.c
+12 −0 src/util/pm_string.c
+0 −2 templates/sig/prism.rbs.erb
+0 −2 templates/sig/prism/node.rbs.erb
+5 −8 templates/src/diagnostic.c.erb
+64 −0 templates/src/node.c.erb
+1 −1 templates/src/token_type.c.erb
+1 −1 test/prism/comments_test.rb
+5 −40 test/prism/errors_test.rb
+58 −0 test/prism/format_errors_test.rb
+5 −1 test/prism/integer_parse_test.rb
+2 −183 test/prism/locals_test.rb
+14 −18 test/prism/location_test.rb
+17 −0 test/prism/memsize_test.rb
+1 −2 test/prism/newline_test.rb
+1 −1 test/prism/parse_test.rb
+61 −59 test/prism/regexp_test.rb
+9 −0 test/prism/ruby_parser_test.rb
+40 −33 test/prism/snapshots/numbers.txt
+24 −18 test/prism/snapshots/patterns.txt
+8 −6 test/prism/snapshots/seattlerb/ruby21_numbers.txt
+4 −3 test/prism/snapshots/symbols.txt
+14 −12 test/prism/snapshots/unparser/corpus/literal/literal.txt
+7 −6 test/prism/snapshots/unparser/corpus/semantic/literal.txt
+7 −6 test/prism/snapshots/whitequark/complex.txt
+7 −6 test/prism/snapshots/whitequark/rational.txt
+12 −12 test/prism/snapshots/whitequark/ruby_bug_11873_a.txt
+3 −2 test/prism/static_inspect_test.rb
+1 −18 test/prism/warnings_test.rb

0 comments on commit 634972d

Please sign in to comment.