Commit ff544e39 authored by Jimmy Aguilar Mena's avatar Jimmy Aguilar Mena

Optimize conditional recursive merge face.

* src/xfaces.c (merge_face_vectors) : Pass ATTR_FILTER to
merge_face_ref to stop recursion merging in advance when possible.
(merge_named_face) : add more conditions to potentially reduce calls to
merge_face_vectors in more unneeded situations.
parent 87980c22
Pipeline #3825 failed with stage
in 55 minutes and 18 seconds
......@@ -2085,7 +2085,7 @@ merge_face_vectors (struct window *w, struct frame *f,
memcpy (tmp, to, LFACE_VECTOR_SIZE * sizeof *tmp);
merge_face_ref (w, f, from[LFACE_INHERIT_INDEX],
tmp, false, named_merge_points, 0);
tmp, false, named_merge_points, attr_filter);
if (NILP (tmp[attr_filter])
|| UNSPECIFIEDP (tmp[attr_filter]))
......@@ -2172,7 +2172,12 @@ merge_named_face (struct window *w,
bool ok = get_lface_attributes (w, f, face_name, from, false,
named_merge_points);
if (ok && (attr_filter == 0 || !NILP(from[attr_filter])))
if (ok && (attr_filter == 0 /* No filter. */
|| (!NILP(from[attr_filter]) /* Filter, but specified. */
&& !UNSPECIFIEDP(from[attr_filter]))
|| (!NILP(from[attr_filter]) /* Filter, unspecified, but inherited. */
&& UNSPECIFIEDP(from[attr_filter])
&& !NILP (from[LFACE_INHERIT_INDEX]))))
merge_face_vectors (w, f, from, to, named_merge_points, attr_filter);
return ok;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment