From 901f2aca813443ecf0d43694aaf6244989587c84 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 19 Sep 2017 13:54:47 +0200 Subject: =?UTF-8?q?Meilleur=20v=C3=A9rification=20des=20doublons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- todo.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'todo.cpp') diff --git a/todo.cpp b/todo.cpp index 56caea3..fd9cfba 100755 --- a/todo.cpp +++ b/todo.cpp @@ -222,13 +222,14 @@ int main(int argc, char *argv[]) { cout << "Chaine vide" << endl; break; } else { + todo tmpTodo = todoFromCmd(sargv); for ( int i = listTodo.size()-1; i >= 0 ; --i) - if( listTodo.at(i).str == sargv ) { + if( listTodo.at(i).str == tmpTodo.str ) { cerr << "Erreur doublon" << endl; exit(-1); break; } - listTodo.push_back(todoFromCmd(sargv)); + listTodo.push_back(tmpTodo); } break; -- cgit v1.2.3