hash_util: Simplify pm_with_uri.

This is easier to read and faster, because it
avoids some unnecessary encoding on the pm-with
part, plus just a lot of extra logic that amounts
to just appending the slug.

Performance for this function is relevant because it is used
for every user every time we rerender the right sidebar.
This commit is contained in:
Steve Howell 2020-01-12 22:18:35 +00:00 committed by Tim Abbott
parent 9f590889b7
commit 9f8eccdbbf
1 changed files with 2 additions and 3 deletions

View File

@ -114,9 +114,8 @@ exports.by_sender_uri = function (reply_to) {
}; };
exports.pm_with_uri = function (reply_to) { exports.pm_with_uri = function (reply_to) {
return exports.operators_to_hash([ const slug = people.emails_to_slug(reply_to);
{operator: 'pm-with', operand: reply_to}, return "#narrow/pm-with/" + slug;
]);
}; };
exports.huddle_with_uri = function (user_ids_string) { exports.huddle_with_uri = function (user_ids_string) {