Commit 2d7eba6f

2d7eba6fc3ddMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 3 files · ~3 modified

Description

refactor: rename stale helper names after coverage expanded

Two helpers grew to cover more than their names suggested:

is_lengthlike_only_method -> is_collection_query_method. Originally just length / size / empty? per #552; gained include? in #558. The new name reflects "methods that query a container's shape" rather than just "length-like".

scan_for_dig_usage -> scan_for_container_typedef_usage. Pre-scans for recv.dig(...) per #555 case 07; gained the same pattern for recv.include?(...) in #558. Both arm the Sym-keyed and Str-poly-keyed hash typedef @needs flags so emit_dig_step / emit_poly_builtin_dispatch can reference the typedefs unconditionally.

No behavior change; pure rename + comment refresh.

Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

Details

Commit
2d7eba6fc3dd
Parent
1961599cfed8

spinel_analyze.rbmodifiedView file

@@ -11998,7 +11998,7 @@
1199811998 # storage. Issue #552. Conservative list: only methods that
1199911999 # truly don't exist on Integer (so widening is sound and no
1200012000 # caller breaks from a previously-int-typed arg path).
12001- def is_lengthlike_only_method(mname)
12001+ def is_collection_query_method(mname)
1200212002 if mname == "length" || mname == "size"
1200312003 return 1
1200412004 end
@@ -12036,7 +12036,7 @@
1203612036 saw = 0
1203712037 kk = 0
1203812038 while kk < called.length
12039- if is_lengthlike_only_method(called[kk]) == 1
12039+ if is_collection_query_method(called[kk]) == 1
1204012040 saw = 1
1204112041 end
1204212042 kk = kk + 1
@@ -12079,7 +12079,7 @@
1207912079 sawc = 0
1208012080 kk = 0
1208112081 while kk < called_c.length
12082- if is_lengthlike_only_method(called_c[kk]) == 1
12082+ if is_collection_query_method(called_c[kk]) == 1
1208312083 sawc = 1
1208412084 end
1208512085 kk = kk + 1