message: Replace while with for
diff: @@ -38,9 +38,7 @@ MatrixAction.prototype.formatMentions = function(nickUserIdMap) {
  const userRegex = new RegExp(regexString, "igm");
  const matched = new Set(); // lowercased nicknames we have matched already.
  let match;
  - let i = 0;
  - while ((match = userRegex.exec(this.text)) !== null && i < MAX_MATCHES) {
  - i++;
  + for (let i = 0; i < MAX_MATCHES && (match = userRegex.exec(this.text)) !== null; i++) {
  let matchName = match[1];
  // Deliberately have a minimum length to match on, so we don't match smaller nicks accidentally.
  if (matchName.length < PILL_MIN_LENGTH_TO_MATCH || matched.has(matchName.toLowerCase())) {
  