From 072faf7d033704339e9607c4c962741b4905e86a Mon Sep 17 00:00:00 2001 From: Madpeter Date: Mon, 11 May 2020 13:13:51 +0100 Subject: [PATCH] makes the code easyer to understand --- Core/Commands/Group/GroupActiveGroup.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Core/Commands/Group/GroupActiveGroup.cs b/Core/Commands/Group/GroupActiveGroup.cs index e87b848..692c422 100644 --- a/Core/Commands/Group/GroupActiveGroup.cs +++ b/Core/Commands/Group/GroupActiveGroup.cs @@ -14,27 +14,23 @@ namespace BSB.Commands.Group { if (base.CallFunction(args) == true) { - UUID group_uuid = UUID.Zero; - if(UUID.TryParse(args[0],out group_uuid) == false) + if (UUID.TryParse(args[0], out UUID group_uuid) != true) { - foreach(KeyValuePair G in bot.MyGroups) + foreach (KeyValuePair G in bot.MyGroups) { - if(G.Value.Name == args[0]) + if (G.Value.Name == args[0]) { group_uuid = G.Key; break; } } - if (group_uuid == UUID.Zero) - { - return Failed("Unable to find group"); - } } if (group_uuid != UUID.Zero) { bot.GetClient.Groups.ActivateGroup(group_uuid); return true; } + return Failed("Unable to find group"); } return false; }