Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplify constant definition method.

  • Loading branch information...
commit dd56975260f244f82e2c4be48b9e143ca67e0a55 1 parent ee594b8
@mvz authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/gir_ffi/builder_helper.rb
View
7 lib/gir_ffi/builder_helper.rb
@@ -9,10 +9,11 @@ def const_defined_for parent, name
end
def optionally_define_constant parent, name
- unless const_defined_for parent, name
- parent.const_set name, yield
+ if const_defined_for parent, name
+ parent.const_get name
+ else
+ parent.const_set name, yield
end
- parent.const_get name
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.