Commit d5957bb6

d5957bb663d6Merged

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

Description

chore(codegen): drop redundant ptr_array guard in compile_array_method_expr

PR #94 collapsed is_array_type(t) || is_ptr_array_type(t) disjunctions into the single is_array_type helper after folding ptr_array into it. The guard added by PR #88 in this site was missed by the rebase ordering (merged in between #82 and #94), so the redundant && is_ptr_array_type (recv_type) == 0 and its outdated comment lingered. Drop both.

Refs #94 #88

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

Details

Commit
d5957bb663d6
Parent
5ba02252d2e5

spinel_codegen.rbmodifiedView file

@@ -15120,10 +15120,7 @@
1512015120 # `def sample`, `def first`) would be dispatched as that Array
1512115121 # method, with `array_c_prefix` falling back to `IntArray` and
1512215122 # the receiver pointer used as if it were an `sp_IntArray *`.
15123- # `is_array_type` deliberately omits *_ptr_array (see its
15124- # docstring), so include it explicitly here — Array#length, #[],
15125- # #each, … all work on a ptr_array via `sp_PtrArray_*`.
15126- if is_array_type(recv_type) == 0 && is_ptr_array_type(recv_type) == 0
15123+ if is_array_type(recv_type) == 0
1512715124 return ""
1512815125 end
1512915126 # Array#inspect and Array#to_s (CRuby aliases them for arrays, so