From 3cffffcdc6f7b6bfe9c8aba410065ee978166e44 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 27 Aug 2016 16:10:17 +0200 Subject: [PATCH] Save asset blacklist when removing items only if the list changed --- indra/newview/fsassetblacklist.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/indra/newview/fsassetblacklist.cpp b/indra/newview/fsassetblacklist.cpp index 1cbf34424e..7f744ca362 100644 --- a/indra/newview/fsassetblacklist.cpp +++ b/indra/newview/fsassetblacklist.cpp @@ -138,18 +138,22 @@ void FSAssetBlacklist::removeItemFromBlacklist(const LLUUID& id) void FSAssetBlacklist::removeItemsFromBlacklist(const uuid_vec_t& ids) { - LLSD data; - - for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + if (!ids.empty()) { - removeItem(*it); - data.append((*it).asString()); - } - saveBlacklist(); + LLSD data; - if (!mBlacklistChangedCallback.empty()) - { - mBlacklistChangedCallback(data, BLACKLIST_REMOVE); + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + removeItem(*it); + data.append((*it).asString()); + } + + saveBlacklist(); + + if (!mBlacklistChangedCallback.empty()) + { + mBlacklistChangedCallback(data, BLACKLIST_REMOVE); + } } }