[SQL Lab] Improve autocomplete performance (#9064)

This commit is contained in:
Erik Ritter 2020-02-02 09:13:25 -08:00 committed by GitHub
parent 7364024bba
commit f9c8ca5df2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -155,7 +155,12 @@ class AceEditorWrapper extends React.PureComponent {
});
},
};
const words = this.state.words.map(word => ({ ...word, completer }));
// Mutate instead of object spread here for performance
const words = this.state.words.map(word => {
/* eslint-disable-next-line no-param-reassign */
word.completer = completer;
return word;
});
callback(null, words);
}
setAutoCompleter(props) {