Skip to content

Commit dce67ad

Browse files
committed
Remove unused memoized caches from Context
Remove class_attributes, instance_attributes, and instance_method_list methods that had zero callers. Remove memoization from class_method_list and instance_methods since they are only called once per class/module during generation, making the caching unnecessary and problematic for server mode where methods can change between re-parses.
1 parent d7d58e6 commit dce67ad

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

lib/rdoc/code_object/context.rb

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -640,18 +640,11 @@ def child_name(name)
640640
end
641641
end
642642

643-
##
644-
# Class attributes
645-
646-
def class_attributes
647-
@class_attributes ||= attributes.select { |a| a.singleton }
648-
end
649-
650643
##
651644
# Class methods
652645

653646
def class_method_list
654-
@class_method_list ||= method_list.select { |a| a.singleton }
647+
method_list.select { |a| a.singleton }
655648
end
656649

657650
##
@@ -951,28 +944,11 @@ def http_url
951944
File.join(*path.compact) + '.html'
952945
end
953946

954-
##
955-
# Instance attributes
956-
957-
def instance_attributes
958-
@instance_attributes ||= attributes.reject { |a| a.singleton }
959-
end
960-
961947
##
962948
# Instance methods
963949

964950
def instance_methods
965-
@instance_methods ||= method_list.reject { |a| a.singleton }
966-
end
967-
968-
##
969-
# Instance methods
970-
#--
971-
# TODO remove this later
972-
973-
def instance_method_list
974-
warn '#instance_method_list is obsoleted, please use #instance_methods'
975-
@instance_methods ||= method_list.reject { |a| a.singleton }
951+
method_list.reject { |a| a.singleton }
976952
end
977953

978954
##

0 commit comments

Comments
 (0)