diff options
| author | 2025-05-20 06:32:39 +0200 | |
|---|---|---|
| committer | 2025-05-20 06:32:39 +0200 | |
| commit | aa49cf4222e24535b577649add66be8f90cca17f (patch) | |
| tree | 96e63bc2a4e2a4e1869c5b84bbafe7d434d2f435 /html.c | |
| parent | Improved post language markup. (diff) | |
| parent | performance: use following_list_len in more places (diff) | |
| download | penes-snac2-aa49cf4222e24535b577649add66be8f90cca17f.tar.gz penes-snac2-aa49cf4222e24535b577649add66be8f90cca17f.tar.xz penes-snac2-aa49cf4222e24535b577649add66be8f90cca17f.zip | |
Merge pull request 'Faster performance metrics' (#395) from dandelions/snac2:pr-faster-metric into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/395
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 12 |
1 files changed, 2 insertions, 10 deletions
| @@ -811,11 +811,7 @@ xs_html *html_user_head(snac *user, const char *desc, const char *url) | |||
| 811 | 811 | ||
| 812 | /* show metrics in og:description? */ | 812 | /* show metrics in og:description? */ |
| 813 | if (xs_is_true(xs_dict_get(user->config, "show_contact_metrics"))) { | 813 | if (xs_is_true(xs_dict_get(user->config, "show_contact_metrics"))) { |
| 814 | xs *fwers = follower_list(user); | 814 | xs *s1 = xs_fmt(L("%d following, %d followers"), following_list_len(user), follower_list_len(user)); |
| 815 | xs *fwing = following_list(user); | ||
| 816 | |||
| 817 | xs *s1 = xs_fmt(L("%d following, %d followers"), | ||
| 818 | xs_list_len(fwing), xs_list_len(fwers)); | ||
| 819 | 815 | ||
| 820 | s1 = xs_str_cat(s1, " · "); | 816 | s1 = xs_str_cat(s1, " · "); |
| 821 | 817 | ||
| @@ -1156,11 +1152,7 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 1156 | } | 1152 | } |
| 1157 | 1153 | ||
| 1158 | if (xs_is_true(xs_dict_get(user->config, "show_contact_metrics"))) { | 1154 | if (xs_is_true(xs_dict_get(user->config, "show_contact_metrics"))) { |
| 1159 | xs *fwers = follower_list(user); | 1155 | xs *s1 = xs_fmt(L("%d following, %d followers"), following_list_len(user), follower_list_len(user)); |
| 1160 | xs *fwing = following_list(user); | ||
| 1161 | |||
| 1162 | xs *s1 = xs_fmt(L("%d following, %d followers"), | ||
| 1163 | xs_list_len(fwing), xs_list_len(fwers)); | ||
| 1164 | 1156 | ||
| 1165 | xs_html_add(top_user, | 1157 | xs_html_add(top_user, |
| 1166 | xs_html_tag("p", | 1158 | xs_html_tag("p", |