Skip to content

Commit

Permalink
Make core.get_favorites("local") ignore duplicates (#7926)
Browse files Browse the repository at this point in the history
  • Loading branch information
p-ouellette authored and SmallJoker committed Nov 8, 2019
1 parent 2a74727 commit d11bfa3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/serverlist.cpp
Expand Up @@ -155,6 +155,16 @@ std::vector<ServerListSpec> deSerialize(const std::string &liststring)
server["address"] = tmp;
std::getline(stream, tmp);
server["port"] = tmp;
bool unique = true;
for (const ServerListSpec &added : serverlist) {
if (server["name"] == added["name"]
&& server["port"] == added["port"]) {
unique = false;
break;
}
}
if (!unique)
continue;
std::getline(stream, tmp);
server["description"] = tmp;
serverlist.push_back(server);
Expand Down

0 comments on commit d11bfa3

Please sign in to comment.