From b9d03165b52cc184469c608323e9d08aa9c534d1 Mon Sep 17 00:00:00 2001 From: VladimirSafronov Date: Sun, 20 Nov 2022 21:41:29 +0300 Subject: [PATCH] refactored ArrayStorage --- src/ArrayStorage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ArrayStorage.java b/src/ArrayStorage.java index a53f9d96..f4ae4369 100644 --- a/src/ArrayStorage.java +++ b/src/ArrayStorage.java @@ -31,9 +31,9 @@ Resume get(String uuid) { void delete(String uuid) { for (int i = 0; i < storageSize; i++) { if (uuid.equals(storage[i].uuid)) { - storage[i] = storage[storageSize - 1]; - storage[storageSize - 1] = null; storageSize--; + storage[i] = storage[storageSize]; + storage[storageSize] = null; break; } }