/ src / database_helper_functions.cpp
database_helper_functions.cpp
 1  /**
 2   * @file database_helper_functions.cpp
 3   * @author Rene Ceska xceska06 (xceska06@stud.fit.vutbr.cz)
 4   * @date 2023-11-19
 5   */
 6  #include "inc/database_helper_functions.h"
 7  
 8  std::vector<DatabaseObject>
 9  removeDuplicates(std::vector<DatabaseObject> input) {
10    std::vector<DatabaseObject> result;
11    for (unsigned long int i = 0; i < input.size(); i++) {
12      bool found = false;
13      for (unsigned long int j = 0; j < result.size(); j++) {
14        if (input[i].get_uid() == result[j].get_uid()) {
15          found = true;
16          break;
17        }
18      }
19      if (!found) {
20        result.push_back(input[i]);
21      }
22    }
23    return result;
24  }