Skip to content

Commit 8fd560d

Browse files
committed
[GR-19691] Comment why feature_path_loaded? is written this way
PullRequest: truffleruby/3799
2 parents 1965a88 + aae1d1a commit 8fd560d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/ruby/truffleruby/core/truffle/feature_loader.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ def self.feature_provided?(feature, expanded)
198198
# MRI: loaded_feature_path
199199
# Search if $LOAD_PATH[i]/feature corresponds to loaded_feature.
200200
# Returns the $LOAD_PATH entry containing feature.
201+
# This method is optimized to avoid unnecessary allocations, e.g., created by string interpolation.
202+
# See https://github.com/oracle/truffleruby/pull/3010#discussion_r1172486950
201203
def self.feature_path_loaded?(loaded_feature, feature, load_path)
202204
name_ext = extension(loaded_feature)
203205

0 commit comments

Comments
 (0)