зеркало из https://github.com/github/ruby.git
eval_error.c: trivial optimization
* eval_error.c (warn_print): optimize warn_print with a string literal, with rb_write_error2 instead of rb_write_error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
53fbaeab29
Коммит
62f20b9d58
|
@ -3,7 +3,16 @@
|
|||
* included by eval.c
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && !defined(__PCC__)
|
||||
#define warn_print(x) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(x)) ? \
|
||||
rb_write_error2((x), (long)strlen(x)) : \
|
||||
rb_write_error(x); \
|
||||
})
|
||||
#else
|
||||
#define warn_print(x) rb_write_error(x)
|
||||
#endif
|
||||
#define warn_print2(x,l) rb_write_error2((x),(l))
|
||||
#define warn_print_str(x) rb_write_error_str(x)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче