mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
Micro-optimization: speed up equal() a bit
Just see if x and y are the same before type checking; this shaves off a bit of time in the benchmark (IE, under heavy loads).
This commit is contained in:
parent
17daa82bb9
commit
7786181722
1 changed files with 2 additions and 0 deletions
|
@ -632,6 +632,8 @@ void Cyc_rt_raise_msg(void *data, const char *err)
|
||||||
|
|
||||||
int equal(object x, object y)
|
int equal(object x, object y)
|
||||||
{
|
{
|
||||||
|
if (x == y)
|
||||||
|
return 1;
|
||||||
if (x == NULL)
|
if (x == NULL)
|
||||||
return (y == NULL);
|
return (y == NULL);
|
||||||
if (y == NULL)
|
if (y == NULL)
|
||||||
|
|
Loading…
Add table
Reference in a new issue