Skip to content

Commit

Permalink
Merge pull request #615 from matrix-org/dbkr/intern_legacy_membership
Browse files Browse the repository at this point in the history
Intern legacy top-level 'membership' field
  • Loading branch information
dbkr authored Feb 22, 2018
2 parents 9460541 + a72f915 commit 6f95554
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/models/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ module.exports.MatrixEvent = function MatrixEvent(
// intern the values of matrix events to force share strings and reduce the
// amount of needless string duplication. This can save moderate amounts of
// memory (~10% on a 350MB heap).
["state_key", "type", "sender", "room_id"].forEach((prop) => {
// 'membership' at the event level (rather than the content level) is a legacy
// field that Riot never otherwise looks at, but it will still take up a lot
// of space if we don't intern it.
["state_key", "type", "sender", "room_id", "membership"].forEach((prop) => {
if (!event[prop]) {
return;
}
Expand Down

0 comments on commit 6f95554

Please sign in to comment.