From 5617eca4f3358b8cfae1dee24d86bbd70ffaf571 Mon Sep 17 00:00:00 2001
From: i107760 <13422-i107760@users.noreply.gitgud.io>
Date: Sat, 24 Oct 2020 02:05:07 +0200
Subject: [PATCH] Simplification

---
 src/js/DefaultRules.js | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js
index a73ed4278d7..fc7288d1b90 100644
--- a/src/js/DefaultRules.js
+++ b/src/js/DefaultRules.js
@@ -1962,7 +1962,6 @@ globalThis.DefaultRules = (function() {
 	 */
 	function ProcessRelease(slave, rule) {
 		if ((rule.releaseRules !== undefined) && (rule.releaseRules !== null)) {
-			let changed = false;
 			const releaseProperties = [
 				'masturbation',
 				'partner',
@@ -1971,19 +1970,18 @@ globalThis.DefaultRules = (function() {
 				'slaves',
 				'master',
 			];
+			let changed = false;
 
-			let processReleaseProp = (property) => {
-				if (rule.releaseRules[property] !== undefined && rule.releaseRules[property] !== null) {
+			function processReleaseProp(property) {
 					if (slave.rules.release[property] !== rule.releaseRules[property]) {
 						slave.rules.release[property] = rule.releaseRules[property];
 						return true;
 					}
-				}
-				return false;
-			};
+					return false;
+			}
 
-			for (const release of releaseProperties) {
-				if (processReleaseProp(release)) {
+			for (const property of releaseProperties) {
+				if (processReleaseProp(property)) {
 					changed = true;
 				}
 			}
-- 
GitLab