Mistři v programování na #hovnokod

Java #4646

Nazvoslovie: favs ~ favorites, songJson ~ songId, replace ~ removeIfExists, isAvailable ~ wasRemoved

private boolean addFavs(String songJson, boolean replace) {
Set<String> favs = getFavs();
boolean isAvailable = false;
if(!favs.contains(songJson)) {
    favs.add(songJson);
} else {
    if(replace) {
         favs.remove(songJson);
         isAvailable = true;
    }
}
// ...
}

Anonymous,