From b71b1b55358d502bd3106b11c41821563112ef1c Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 30 Sep 2016 09:39:30 +0100 Subject: [PATCH] Use more variables --- src/components/structures/RoomDirectory.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 4c306a7a..5fc848cb 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -64,11 +64,12 @@ module.exports = React.createClass({ this.nativePatterns = {}; if (this.props.config.networks) { for (const network of Object.keys(this.props.config.networks)) { - if (this.props.config.networks[network].portalRoomPattern) { - this.portalRoomPatterns[network] = new RegExp(this.props.config.networks[network].portalRoomPattern); + const network_info = this.props.config.networks[network]; + if (network_info.portalRoomPattern) { + this.portalRoomPatterns[network] = new RegExp(network_info.portalRoomPattern); } - if (this.props.config.networks[network].nativePattern) { - this.nativePatterns[network] = new RegExp(this.props.config.networks[network].nativePattern); + if (network_info.nativePattern) { + this.nativePatterns[network] = new RegExp(network_info.nativePattern); } } }