[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
This commit is contained in:
Mau Magnaguagno 2023-10-15 02:42:56 -03:00 committed by git
parent fe08839d8a
commit 55a0d2c63b

View File

@ -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