From 91fa2122a536770924bb2819bec4b79e76393d08 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 11 Sep 2012 20:03:02 +0300 Subject: Fix code style and small perfomance issues. --- src/net/download.cpp | 2 +- src/net/ea/gamehandler.cpp | 2 +- src/net/ea/gamehandler.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/net') diff --git a/src/net/download.cpp b/src/net/download.cpp index 5d35e1ace..9c9a777fa 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -206,7 +206,6 @@ int Download::downloadThread(void *ptr) while (attempts < 3 && !complete && !d->mOptions.cancel) { - FILE *file = nullptr; d->mUpdateFunction(d->mPtr, DOWNLOAD_STATUS_STARTING, 0, 0); @@ -221,6 +220,7 @@ int Download::downloadThread(void *ptr) if (d->mCurl && !d->mOptions.cancel) { + FILE *file = nullptr; logger->log("Downloading: %s", d->mUrl.c_str()); curl_easy_setopt(d->mCurl, CURLOPT_FOLLOWLOCATION, 1); diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index 1cb105204..ededed886 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -62,7 +62,7 @@ void GameHandler::who() { } -void GameHandler::setMap(const std::string map) +void GameHandler::setMap(const std::string &map) { mMap = map.substr(0, map.rfind(".")); } diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h index de7a1623d..ba68c710e 100644 --- a/src/net/ea/gamehandler.h +++ b/src/net/ea/gamehandler.h @@ -45,7 +45,7 @@ class GameHandler : public Net::GameHandler, public Listener virtual bool removeDeadBeings() const { return true; } - virtual void setMap(const std::string map); + virtual void setMap(const std::string &map); virtual bool canUseMagicBar() const { return true; } -- cgit v1.2.3-70-g09d2