Revision: 4159 http://trac.macosforge.org/projects/ruby/changeset/4159 Author: lsansonetti@apple.com Date: 2010-05-25 22:30:07 -0700 (Tue, 25 May 2010) Log Message: ----------- faster r{ary,hash,str}_modify() functions Modified Paths: -------------- MacRuby/trunk/array.h MacRuby/trunk/dispatcher.cpp MacRuby/trunk/encoding.h MacRuby/trunk/hash.h Modified: MacRuby/trunk/array.h =================================================================== --- MacRuby/trunk/array.h 2010-05-26 03:58:42 UTC (rev 4158) +++ MacRuby/trunk/array.h 2010-05-26 05:30:07 UTC (rev 4159) @@ -48,8 +48,10 @@ if ((mask & FL_FREEZE) == FL_FREEZE) { rb_raise(rb_eRuntimeError, "can't modify frozen/immutable array"); } - if ((mask & FL_TAINT) == FL_TAINT && rb_safe_level() >= 4) { - rb_raise(rb_eSecurityError, "Insecure: can't modify array"); + if ((mask & FL_TAINT) == FL_TAINT) { + if (rb_safe_level() >= 4) { + rb_raise(rb_eSecurityError, "Insecure: can't modify array"); + } } } Modified: MacRuby/trunk/dispatcher.cpp =================================================================== --- MacRuby/trunk/dispatcher.cpp 2010-05-26 03:58:42 UTC (rev 4158) +++ MacRuby/trunk/dispatcher.cpp 2010-05-26 05:30:07 UTC (rev 4159) @@ -14,10 +14,6 @@ #include "compiler.h" #include "objc.h" #include "dtrace.h" -#include "array.h" -#include "hash.h" -#include "encoding.h" -#include "re.h" #include "class.h" #include <execinfo.h> Modified: MacRuby/trunk/encoding.h =================================================================== --- MacRuby/trunk/encoding.h 2010-05-26 03:58:42 UTC (rev 4158) +++ MacRuby/trunk/encoding.h 2010-05-26 05:30:07 UTC (rev 4159) @@ -89,8 +89,10 @@ if ((mask & FL_FREEZE) == FL_FREEZE) { rb_raise(rb_eRuntimeError, "can't modify frozen/immutable string"); } - if ((mask & FL_TAINT) == FL_TAINT && rb_safe_level() >= 4) { - rb_raise(rb_eSecurityError, "Insecure: can't modify string"); + if ((mask & FL_TAINT) == FL_TAINT) { + if (rb_safe_level() >= 4) { + rb_raise(rb_eSecurityError, "Insecure: can't modify string"); + } } } Modified: MacRuby/trunk/hash.h =================================================================== --- MacRuby/trunk/hash.h 2010-05-26 03:58:42 UTC (rev 4158) +++ MacRuby/trunk/hash.h 2010-05-26 05:30:07 UTC (rev 4159) @@ -45,8 +45,10 @@ if ((mask & FL_FREEZE) == FL_FREEZE) { rb_raise(rb_eRuntimeError, "can't modify frozen/immutable hash"); } - if ((mask & FL_TAINT) == FL_TAINT && rb_safe_level() >= 4) { - rb_raise(rb_eSecurityError, "Insecure: can't modify hash"); + if ((mask & FL_TAINT) == FL_TAINT) { + if (rb_safe_level() >= 4) { + rb_raise(rb_eSecurityError, "Insecure: can't modify hash"); + } } }
participants (1)
-
source_changes@macosforge.org