Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions extensions/assets-manager/AssetsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void AssetsManager::createDirectory(const std::string& path)

// Create path recursively
subpath = "";
for (int i = 0; i < dirs.size(); i++) {
for (int i = 0; i < dirs.size(); ++i) {
subpath += dirs[i];
dir = opendir (subpath.c_str());
if (!dir)
Expand Down Expand Up @@ -441,7 +441,7 @@ void AssetsManager::startUpdate()
_downloadUnits.clear();
_totalWaitToDownload = _totalToDownload = 0;
std::string packageUrl = _remoteManifest->getPackageUrl();
for (auto it = diff_map.begin(); it != diff_map.end(); it++) {
for (auto it = diff_map.begin(); it != diff_map.end(); ++it) {
Manifest::AssetDiff diff = it->second;

if (diff.type == Manifest::DiffType::DELETED) {
Expand Down Expand Up @@ -568,7 +568,7 @@ void AssetsManager::update()

void AssetsManager::batchDownload(const std::unordered_map<std::string, Downloader::DownloadUnit> &units)
{
for (auto it = units.cbegin(); it != units.cend(); it++) {
for (auto it = units.cbegin(); it != units.cend(); ++it) {
Downloader::DownloadUnit unit = it->second;
std::string srcUrl = unit.srcUrl;
std::string storagePath = unit.storagePath;
Expand Down
7 changes: 5 additions & 2 deletions extensions/assets-manager/Downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
****************************************************************************/

#include "Downloader.h"
#include "base/threadpool.hpp"

#include <curl/curl.h>
#include <curl/easy.h>
Expand All @@ -39,6 +38,10 @@ NS_CC_EXT_BEGIN
#define LOW_SPEED_LIMIT 1L
#define LOW_SPEED_TIME 5L

#if USE_THREAD_POOL
#include "base/threadpool.hpp"
#endif

#define POOL() static_cast<threadpool::pool*>(this->_threadPool)

static size_t curlWriteFunc(void *ptr, size_t size, size_t nmemb, void *userdata)
Expand Down Expand Up @@ -186,7 +189,7 @@ void Downloader::downloadSync(const std::string &srcUrl, const std::string &stor

void Downloader::batchDownload(const std::unordered_map<std::string, Downloader::DownloadUnit> &units)
{
for (auto it = units.cbegin(); it != units.cend(); it++) {
for (auto it = units.cbegin(); it != units.cend(); ++it) {
DownloadUnit unit = it->second;
std::string srcUrl = unit.srcUrl;
std::string storagePath = unit.storagePath;
Expand Down
8 changes: 4 additions & 4 deletions extensions/assets-manager/Manifest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ bool Manifest::versionEquals(const Manifest *b) const
return false;

// Check groups version
for (int i = 0; i < _groups.size(); i++) {
for (int i = 0; i < _groups.size(); ++i) {
std::string gid =_groups[i];
// Check group name
if (gid != bGroups[i])
Expand All @@ -147,7 +147,7 @@ std::unordered_map<std::string, Manifest::AssetDiff> Manifest::genDiff(const Man
Asset valueA;
Asset valueB;
std::unordered_map<std::string, Asset>::const_iterator valueIt, it;
for (it = _assets.begin(); it != _assets.end(); it++)
for (it = _assets.begin(); it != _assets.end(); ++it)
{
key = it->first;
valueA = it->second;
Expand All @@ -172,7 +172,7 @@ std::unordered_map<std::string, Manifest::AssetDiff> Manifest::genDiff(const Man
}
}

for (it = bAssets.begin(); it != bAssets.end(); it++)
for (it = bAssets.begin(); it != bAssets.end(); ++it)
{
key = it->first;
valueB = it->second;
Expand Down Expand Up @@ -385,7 +385,7 @@ void Manifest::loadManifest(const rapidjson::Document &json)
const rapidjson::Value& paths = json[KEY_SEARCH_PATHS];
if (paths.IsArray())
{
for (rapidjson::SizeType i = 0; i < paths.Size(); i++)
for (rapidjson::SizeType i = 0; i < paths.Size(); ++i)
{
if (paths[i].IsString()) {
_searchPaths.push_back(paths[i].GetString());
Expand Down