message: Searching: Move the small helper functions out of the eventIndexSearch function.
diff: @@ -34,8 +34,7 @@ function serverSideSearch(term, roomId = undefined) {
  return searchPromise;
  }
  -function eventIndexSearch(term, roomId = undefined) {
  - const combinedSearchFunc = async (searchTerm) => {
  +async function combinedSearchFunc(searchTerm) {
  // Create two promises, one for the local search, one for the
  // server-side search.
  const client = MatrixClientPeg.get();
  @@ -73,9 +72,9 @@ function eventIndexSearch(term, roomId = undefined) {
  serverSideResult.highlights);
  return result;
  - };
  +}
  - const localSearchFunc = async (searchTerm, roomId = undefined) => {
  +async function localSearchFunc(searchTerm, roomId = undefined) {
  const searchArgs = {
  search_term: searchTerm,
  before_limit: 1,
  @@ -106,8 +105,9 @@ function eventIndexSearch(term, roomId = undefined) {
  emptyResult, response);
  return result;
  - };
  +}
  +function eventIndexSearch(term, roomId = undefined) {
  let searchPromise;
  if (roomId !== undefined) {
  