* [PATCH 2/5] imap: remove some intermediate arrays
2022-08-20 8:01 5% [PATCH 0/5] various minor annoyance fixups Eric Wong
@ 2022-08-20 8:01 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2022-08-20 8:01 UTC (permalink / raw)
To: meta
We can assign arrays directly without `[]' creating an extra
immortal pad allocation.
---
lib/PublicInbox/IMAP.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm
index 0a65d87c..1f65aa65 100644
--- a/lib/PublicInbox/IMAP.pm
+++ b/lib/PublicInbox/IMAP.pm
@@ -1005,7 +1005,7 @@ sub fetch_compile ($) {
# stabilize partial order for consistency and ease-of-debugging:
if (scalar keys %partial) {
$need |= NEED_BLOB;
- $r[2] = [ map { [ $_, @{$partial{$_}} ] } sort keys %partial ];
+ @{$r[2]} = map { [ $_, @{$partial{$_}} ] } sort keys %partial;
}
push @op, $OP_EML_NEW if ($need & (EML_HDR|EML_BDY));
@@ -1028,7 +1028,7 @@ sub fetch_compile ($) {
# r[1] = [ $key1, $cb1, $key2, $cb2, ... ]
use sort 'stable'; # makes output more consistent
- $r[1] = [ map { ($_->[2], $_->[1]) } sort { $a->[0] <=> $b->[0] } @op ];
+ @{$r[1]} = map { ($_->[2], $_->[1]) } sort { $a->[0] <=> $b->[0] } @op;
@r;
}
^ permalink raw reply related [relevance 7%]
* [PATCH 0/5] various minor annoyance fixups
@ 2022-08-20 8:01 5% Eric Wong
2022-08-20 8:01 7% ` [PATCH 2/5] imap: remove some intermediate arrays Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2022-08-20 8:01 UTC (permalink / raw)
To: meta
Some things I noticed while reading the code, some things
I noticed while looking at WWW in w3m. There were more cleanups
related to {base_url} and redundancies in WWW that I could
probably get rid of, but some had unintended side-effects :x
or required more refactoring/cleanups.
Eric Wong (5):
import: take advantage of some Perl 5.10.x features
imap: remove some intermediate arrays
view: do not show pagination footer for small inboxes
www: use absolute URLs for coderepo URLs
www: mbox* drop unneeded {base_url} memoizations
lib/PublicInbox/ExtSearch.pm | 4 +++-
lib/PublicInbox/IMAP.pm | 4 ++--
lib/PublicInbox/Import.pm | 23 ++++++++++-------------
lib/PublicInbox/Inbox.pm | 2 ++
lib/PublicInbox/Mbox.pm | 3 +--
lib/PublicInbox/MboxGz.pm | 3 +--
lib/PublicInbox/View.pm | 9 +++------
lib/PublicInbox/WwwStream.pm | 16 ++++++++--------
lib/PublicInbox/WwwText.pm | 12 ++----------
9 files changed, 32 insertions(+), 44 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-08-20 8:01 5% [PATCH 0/5] various minor annoyance fixups Eric Wong
2022-08-20 8:01 7% ` [PATCH 2/5] imap: remove some intermediate arrays Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).