The sort was unstable on my test instance anyways, and
clients don't seem to mind. So stop wasting CPU cycles.
my $u = $_; # capitalize "INBOX" for user-familiarity
$u =~ s/\Ainbox(\.|\z)/INBOX$1/i;
qq[* LIST (\\Has${no}Children) "." $u\r\n]
- } sort {
- # shortest names first, alphabetically if lengths match
- length($a) == length($b) ?
- ($a cmp $b) :
- (length($a) <=> length($b))
} keys %$mailboxes
];
$imapd->{pi_config} = $pi_config;
pop @new_list;
pop @orig_list;
# TODO: not sure if sort order matters, imapd_refresh_finalize
- # sorts, for now, but maybe clients don't care...
+ # doesn't sort, hopefully clients don't care...
+ @new_list = sort @new_list;
+ @orig_list = sort @orig_list;
is_deeply(\@new_list, \@orig_list, 'LIST identical');
}
ok($mic->close, 'CLOSE works');