Skip to content

Commit 97c9ffe

Browse files
Avoid unnecessary delete_prefix in LibRubyParser.resolve_type
Only remove const prefix from non-pointer types.
1 parent 7935597 commit 97c9ffe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/prism/ffi.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ module LibRubyParser
2525
# void -> :void
2626
#
2727
def self.resolve_type(type)
28-
type = type.strip.delete_prefix("const ")
29-
type.end_with?("*") ? :pointer : type.to_sym
28+
type = type.strip
29+
type.end_with?("*") ? :pointer : type.delete_prefix("const ").to_sym
3030
end
3131

3232
# Read through the given header file and find the declaration of each of the

0 commit comments

Comments
 (0)