summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--class.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/class.c b/class.c
index 7719b06..47bb562 100644
--- a/class.c
+++ b/class.c
@@ -1747,19 +1747,15 @@ rb_undef_methods_from(VALUE klass, VALUE super)
* \{
*/
-#define SPECIAL_SINGLETON(x,c) do {\
- if (obj == (x)) {\
- return (c);\
- }\
-} while (0)
-
static inline VALUE
special_singleton_class_of(VALUE obj)
{
- SPECIAL_SINGLETON(Qnil, rb_cNilClass);
- SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
- SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
- return Qnil;
+ switch (obj) {
+ case Qnil: return rb_cNilClass;
+ case Qfalse: return rb_cFalseClass;
+ case Qtrue: return rb_cTrueClass;
+ default: return Qnil;
+ }
}
VALUE