From c001fee09d34bf1923ff4067bd82bdc4d62bda32 Mon Sep 17 00:00:00 2001 From: franc Date: Mon, 28 Apr 2025 16:04:29 +0200 Subject: [PATCH] Comment code --- .../Services/Instruction/InstructionService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Francesco.Recipes.World/Services/Instruction/InstructionService.cs b/Francesco.Recipes.World/Services/Instruction/InstructionService.cs index 582feff..2b8fdee 100644 --- a/Francesco.Recipes.World/Services/Instruction/InstructionService.cs +++ b/Francesco.Recipes.World/Services/Instruction/InstructionService.cs @@ -43,6 +43,9 @@ return; } + // Instructions are ordered by ascending numbers (1, 2, 3, ...). + // Moving up means swapping with the instruction that has one number less (Number - 1). + // Moving down means swapping with the instruction that has one number more (Number + 1). var targetNumber = moveUp ? instruction.Number - 1 : instruction.Number + 1; var neighbor = instructions.FirstOrDefault(i => i.Number == targetNumber);