From c5e034c3ac71600cb5226f485a0fea38fb7722d1 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 27 Nov 2024 17:14:10 +0100 Subject: [PATCH] Bugfix (assignment used over comparison) --- lab3/UserTable.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lab3/UserTable.cc b/lab3/UserTable.cc index 91db558..ec31eff 100644 --- a/lab3/UserTable.cc +++ b/lab3/UserTable.cc @@ -56,8 +56,8 @@ User UserTable::find(int c) const while (low < high && ! found) { mid = (low + high) / 2; // - int midnbr = users[mid].getCardNbr(); - if (midnbr = c) { + const int midnbr = users[mid].getCardNbr(); + if (c == midnbr) { found = true; } else if (users[mid].getCardNbr() < c) { low = mid + 1;