[latex3-commits] [git/LaTeX3-latex3-latex3] master: Internal optimisation (c3ffdd0)
Joseph Wright
joseph.wright at morningstar2.co.uk
Fri Jan 25 09:27:05 CET 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/c3ffdd0f710723b65adef5332a91aa7977c7b760
>---------------------------------------------------------------
commit c3ffdd0f710723b65adef5332a91aa7977c7b760
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Fri Jan 25 08:27:05 2019 +0000
Internal optimisation
>---------------------------------------------------------------
c3ffdd0f710723b65adef5332a91aa7977c7b760
l3kernel/l3coffins.dtx | 61 ++++++++++++++++++++-----------
l3kernel/testfiles/m3expl001.luatex.tlg | 2 +
l3kernel/testfiles/m3expl001.ptex.tlg | 2 +
l3kernel/testfiles/m3expl001.tlg | 2 +
l3kernel/testfiles/m3expl001.uptex.tlg | 2 +
l3kernel/testfiles/m3expl001.xetex.tlg | 2 +
l3kernel/testfiles/m3expl003.luatex.tlg | 2 +
l3kernel/testfiles/m3expl003.ptex.tlg | 2 +
l3kernel/testfiles/m3expl003.tlg | 2 +
l3kernel/testfiles/m3expl003.uptex.tlg | 2 +
l3kernel/testfiles/m3expl003.xetex.tlg | 2 +
11 files changed, 59 insertions(+), 22 deletions(-)
diff --git a/l3kernel/l3coffins.dtx b/l3kernel/l3coffins.dtx
index e4932c1..e7bb3bf 100644
--- a/l3kernel/l3coffins.dtx
+++ b/l3kernel/l3coffins.dtx
@@ -981,41 +981,50 @@
%
% \begin{macro}{\@@_update_corners:N, \@@_gupdate_corners:N}
% \begin{macro}{\@@_update_corners:NN}
+% \begin{macro}{\@@_update_corners:NNN}
% Updating the corners of a coffin is straight-forward as at this stage
% there can be no rotation. So the corners of the content are just those
% of the underlying \TeX{} box.
% \begin{macrocode}
\cs_new_protected:Npn \@@_update_corners:N #1
- { \@@_update_corners:NN #1 \prop_put:cnx }
+ { \@@_update_corners:NN #1 \prop_put:Nnx }
\cs_new_protected:Npn \@@_gupdate_corners:N #1
- { \@@_update_corners:NN #1 \prop_gput:cnx }
+ { \@@_update_corners:NN #1 \prop_gput:Nnx }
\cs_new_protected:Npn \@@_update_corners:NN #1#2
{
- #2 { coffin ~ \@@_to_value:N #1 ~ corners }
+ \exp_args:Nc \@@_update_corners:NNN
+ { coffin ~ \@@_to_value:N #1 ~ corners }
+ #1 #2
+ }
+\cs_new_protected:Npn \@@_update_corners:NNN #1#2#3
+ {
+ #3 #1
{ tl }
- { { 0pt } { \dim_eval:n { \box_ht:N #1 } } }
- #2 { coffin ~ \@@_to_value:N #1 ~ corners }
+ { { 0pt } { \dim_eval:n { \box_ht:N #2 } } }
+ #3 #1
{ tr }
{
- { \dim_eval:n { \box_wd:N #1 } }
- { \dim_eval:n { \box_ht:N #1 } }
+ { \dim_eval:n { \box_wd:N #2 } }
+ { \dim_eval:n { \box_ht:N #2 } }
}
- #2 { coffin ~ \@@_to_value:N #1 ~ corners }
+ #3 #1
{ bl }
- { { 0pt } { \dim_eval:n { -\box_dp:N #1 } } }
- #2 { coffin ~ \@@_to_value:N #1 ~ corners }
+ { { 0pt } { \dim_eval:n { -\box_dp:N #2 } } }
+ #3 #1
{ br }
{
- { \dim_eval:n { \box_wd:N #1 } }
- { \dim_eval:n { -\box_dp:N #1 } }
+ { \dim_eval:n { \box_wd:N #2 } }
+ { \dim_eval:n { -\box_dp:N #2 } }
}
}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_update_poles:N, \@@_gupdate_poles:N}
% \begin{macro}{\@@_update_poles:NN}
+% \begin{macro}{\@@_update_poles:NNN}
% This function is called when a coffin is set, and updates the poles to
% reflect the nature of size of the box. Thus this function only alters
% poles where the default position is dependent on the size of the box.
@@ -1028,40 +1037,48 @@
{ \@@_update_poles:NN #1 \prop_gput:cnx }
\cs_new_protected:Npn \@@_update_poles:NN #1#2
{
- #2 { coffin ~ \@@_to_value:N #1 ~ poles } { hc }
+ \exp_args:Nc \@@_update_poles:NNN
+ { coffin ~ \@@_to_value:N #1 ~ poles }
+ #1 #2
+ }
+\cs_new_protected:Npn \@@_update_poles:NNN #1#2#3
+ {
+ #3 #1 { hc }
{
- { \dim_eval:n { 0.5 \box_wd:N #1 } }
+ { \dim_eval:n { 0.5 \box_wd:N #2 } }
{ 0pt } { 0pt } { 1000pt }
}
- #2 { coffin ~ \@@_to_value:N #1 ~ poles } { r }
+ #3 #1 { r }
{
- { \dim_eval:n { \box_wd:N #1 } }
+ { \dim_eval:n { \box_wd:N #2 } }
{ 0pt } { 0pt } { 1000pt }
}
- #2 { coffin ~ \@@_to_value:N #1 ~ poles } { vc }
+ #3 #1 { vc }
{
{ 0pt }
- { \dim_eval:n { ( \box_ht:N #1 - \box_dp:N #1 ) / 2 } }
+ { \dim_eval:n { ( \box_ht:N #2 - \box_dp:N #2 ) / 2 } }
{ 1000pt }
{ 0pt }
}
- #2 { coffin ~ \@@_to_value:N #1 ~ poles } { t }
+ #3 #1 { t }
{
{ 0pt }
- { \dim_eval:n { \box_ht:N #1 } }
+ { \dim_eval:n { \box_ht:N #2 } }
{ 1000pt }
{ 0pt }
}
- #2 { coffin ~ \@@_to_value:N #1 ~ poles } { b }
+ #3 #1 { b }
{
{ 0pt }
- { \dim_eval:n { -\box_dp:N #1 } }
+ { \dim_eval:n { -\box_dp:N #2 } }
{ 1000pt }
{ 0pt }
}
}
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{Coffins: calculation of pole intersections}
%
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index d589606..30267a5 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5419,9 +5419,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 1269491..7359e3c 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5715,9 +5715,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 7f75989..2949c30 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5715,9 +5715,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index b8ffd14..9d2bab8 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5712,9 +5712,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 1f2728d..f3f9202 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5430,9 +5430,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index d589606..30267a5 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5419,9 +5419,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 1269491..7359e3c 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5715,9 +5715,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 7f75989..2949c30 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5715,9 +5715,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index b8ffd14..9d2bab8 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5712,9 +5712,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 1f2728d..f3f9202 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5430,9 +5430,11 @@ Defining \__coffin_gupdate:N on line ...
Defining \__coffin_update_corners:N on line ...
Defining \__coffin_gupdate_corners:N on line ...
Defining \__coffin_update_corners:NN on line ...
+Defining \__coffin_update_corners:NNN on line ...
Defining \__coffin_update_poles:N on line ...
Defining \__coffin_gupdate_poles:N on line ...
Defining \__coffin_update_poles:NN on line ...
+Defining \__coffin_update_poles:NNN on line ...
Defining \__coffin_calculate_intersection:Nnn on line ...
Defining \__coffin_calculate_intersection:nnnnnnnn on line ...
Defining \__coffin_calculate_intersection_aux:nnnnnN on line ...
More information about the latex3-commits
mailing list