Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
40bc7ddb
Commit
40bc7ddb
authored
May 30, 2019
by
Paul Eggert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve eq1/memql performance
* src/fns.c (Fmemql, Feql): Inline to tweak performance.
parent
b3549359
Pipeline
#1837
failed with stage
in 55 minutes and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
src/fns.c
src/fns.c
+11
-9
No files found.
src/fns.c
View file @
40bc7ddb
...
...
@@ -1521,7 +1521,7 @@ union double_and_words
EMACS_UINT
word
[
WORDS_PER_DOUBLE
];
};
/* Return true if X and Y
ar
e the same
floating-point
value.
/* Return true if
the floats
X and Y
hav
e the same value.
This looks at X's and Y's representation, since (unlike '==')
it returns true if X and Y are the same NaN. */
static
bool
...
...
@@ -1567,32 +1567,32 @@ DEFUN ("memql", Fmemql, Smemql, 2, 2, 0,
The value is actually the tail of LIST whose car is ELT. */
)
(
Lisp_Object
elt
,
Lisp_Object
list
)
{
Lisp_Object
tail
=
list
;
if
(
FLOATP
(
elt
))
{
Lisp_Object
tail
=
list
;
FOR_EACH_TAIL
(
tail
)
{
Lisp_Object
tem
=
XCAR
(
tail
);
if
(
FLOATP
(
tem
)
&&
same_float
(
elt
,
tem
))
return
tail
;
}
CHECK_LIST_END
(
tail
,
list
);
return
Qnil
;
}
else
if
(
BIGNUMP
(
elt
))
{
Lisp_Object
tail
=
list
;
FOR_EACH_TAIL
(
tail
)
{
Lisp_Object
tem
=
XCAR
(
tail
);
if
(
equal_no_quit
(
elt
,
tem
))
if
(
BIGNUMP
(
tem
)
&&
mpz_cmp
(
XBIGNUM
(
elt
)
->
value
,
XBIGNUM
(
tem
)
->
value
)
==
0
)
return
tail
;
}
CHECK_LIST_END
(
tail
,
list
);
return
Qnil
;
}
else
return
Fmemq
(
elt
,
list
);
CHECK_LIST_END
(
tail
,
list
);
return
Qnil
;
}
DEFUN
(
"assq"
,
Fassq
,
Sassq
,
2
,
2
,
0
,
...
...
@@ -2301,7 +2301,9 @@ This differs from numeric comparison: (eql 0.0 -0.0) returns nil and
if
(
FLOATP
(
obj1
))
return
FLOATP
(
obj2
)
&&
same_float
(
obj1
,
obj2
)
?
Qt
:
Qnil
;
else
if
(
BIGNUMP
(
obj1
))
return
equal_no_quit
(
obj1
,
obj2
)
?
Qt
:
Qnil
;
return
((
BIGNUMP
(
obj2
)
&&
mpz_cmp
(
XBIGNUM
(
obj1
)
->
value
,
XBIGNUM
(
obj2
)
->
value
)
==
0
)
?
Qt
:
Qnil
);
else
return
EQ
(
obj1
,
obj2
)
?
Qt
:
Qnil
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment