Skip to content

Commit

Permalink
Merge pull request #1453 from kk-ds-000/perf/avoid-string-allocations
Browse files Browse the repository at this point in the history
Avoid string allocations when generating object name
  • Loading branch information
lsegal committed Sep 3, 2022
2 parents 0a55093 + 15c8b88 commit 4fe39b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/yard/code_objects/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ def docstring=(comments)
#
# @return [Symbol] the type of code object this represents
def type
self.class.name.split('::').last.gsub(/Object$/, '').downcase.to_sym
obj_name = self.class.name.split('::').last
obj_name.gsub!(/Object$/, '')
obj_name.downcase!
obj_name.to_sym
end

# Represents the unique path of the object. The default implementation
Expand Down

0 comments on commit 4fe39b6

Please sign in to comment.