From 55a0d2c63b5054895e7d7c674ea633807ad9eaf2 Mon Sep 17 00:00:00 2001 From: Mau Magnaguagno Date: Sun, 15 Oct 2023 02:42:56 -0300 Subject: [PATCH] [ruby/prism] Avoid unnecessary delete_prefix in LibRubyParser.resolve_type Only remove const prefix from non-pointer types. https://github.com/ruby/prism/commit/97c9ffeb42 --- lib/prism/ffi.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index 3ff1875611..69b2b35bbb 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -25,8 +25,8 @@ module Prism # void -> :void # def self.resolve_type(type) - type = type.strip.delete_prefix("const ") - type.end_with?("*") ? :pointer : type.to_sym + type = type.strip + type.end_with?("*") ? :pointer : type.delete_prefix("const ").to_sym end # Read through the given header file and find the declaration of each of the