linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #05010
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2741: empty instead of size()
------------------------------------------------------------
revno: 2741
committer: Jacek Sieka <arnetheduck@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Fri 2011-12-23 15:58:25 +0100
message:
empty instead of size()
modified:
dcpp/BufferedSocket.cpp
dcpp/ClientManager.cpp
dcpp/DownloadManager.cpp
dcpp/File.h
dcpp/MerkleTree.h
dcpp/SimpleXMLReader.cpp
dcpp/StringSearch.h
dcpp/Torrent.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/BufferedSocket.cpp'
--- dcpp/BufferedSocket.cpp 2011-11-05 15:46:55 +0000
+++ dcpp/BufferedSocket.cpp 2011-12-23 14:58:25 +0000
@@ -435,7 +435,7 @@
pair<Tasks, unique_ptr<TaskData> > p;
{
Lock l(cs);
- dcassert(tasks.size() > 0);
+ dcassert(!tasks.empty());
p = move(tasks.front());
tasks.erase(tasks.begin());
}
=== modified file 'dcpp/ClientManager.cpp'
--- dcpp/ClientManager.cpp 2011-12-22 22:14:45 +0000
+++ dcpp/ClientManager.cpp 2011-12-23 14:58:25 +0000
@@ -499,7 +499,7 @@
SearchResultList l;
ShareManager::getInstance()->search(l, aString, aSearchType, aSize, aFileType, aClient, isPassive ? 5 : 10);
// dcdebug("Found %d items (%s)\n", l.size(), aString.c_str());
- if(l.size() > 0) {
+ if(!l.empty()) {
if(isPassive) {
string name = aSeeker.substr(4);
// Good, we have a passive seeker, those are easier...
=== modified file 'dcpp/DownloadManager.cpp'
--- dcpp/DownloadManager.cpp 2011-12-22 22:14:45 +0000
+++ dcpp/DownloadManager.cpp 2011-12-23 14:58:25 +0000
@@ -74,7 +74,7 @@
}
}
- if(tickList.size() > 0)
+ if(!tickList.empty())
fire(DownloadManagerListener::Tick(), tickList);
// Automatically remove or disconnect slow sources
=== modified file 'dcpp/File.h'
--- dcpp/File.h 2011-04-13 19:16:51 +0000
+++ dcpp/File.h 2011-12-23 14:58:25 +0000
@@ -93,7 +93,7 @@
static void ensureDirectory(const string& aFile) noexcept;
static bool isAbsolute(const string& path) noexcept;
- virtual ~File() { File::close(); }
+ virtual ~File() { close(); }
string read(size_t len);
string read();
=== modified file 'dcpp/MerkleTree.h'
--- dcpp/MerkleTree.h 2011-04-13 19:16:51 +0000
+++ dcpp/MerkleTree.h 2011-12-23 14:58:25 +0000
@@ -226,7 +226,6 @@
};
typedef MerkleTree<TigerHash> TigerTree;
-typedef TigerTree::MerkleValue TTHValue;
template<int64_t aBlockSize>
struct TTFilter {
=== modified file 'dcpp/SimpleXMLReader.cpp'
--- dcpp/SimpleXMLReader.cpp 2011-12-22 22:14:45 +0000
+++ dcpp/SimpleXMLReader.cpp 2011-12-23 14:58:25 +0000
@@ -542,7 +542,7 @@
error("Greater than maximum allowed size");
if(len == 0) {
- if(elements.size() == 0) {
+ if(elements.empty()) {
// Fine...
return;
}
=== modified file 'dcpp/StringSearch.h'
--- dcpp/StringSearch.h 2011-12-03 21:53:57 +0000
+++ dcpp/StringSearch.h 2011-12-23 14:58:25 +0000
@@ -43,12 +43,12 @@
StringSearch(const StringSearch& rhs) noexcept : pattern(rhs.pattern) {
memcpy(delta1, rhs.delta1, sizeof(delta1));
}
- const StringSearch& operator=(const StringSearch& rhs) {
+ StringSearch& operator=(const StringSearch& rhs) {
memcpy(delta1, rhs.delta1, sizeof(delta1));
pattern = rhs.pattern;
return *this;
}
- const StringSearch& operator=(const string& rhs) {
+ StringSearch& operator=(const string& rhs) {
pattern = Text::toLower(rhs);
initDelta1();
return *this;
=== modified file 'dcpp/Torrent.cpp'
--- dcpp/Torrent.cpp 2011-05-28 15:31:50 +0000
+++ dcpp/Torrent.cpp 2011-12-23 14:58:25 +0000
@@ -135,7 +135,7 @@
std::vector<State> states;
bool inState(State state) {
- return states.size() > 0 && find(states, state) != states.end();
+ return !states.empty() && find(states, state) != states.end();
}
size_t skipDepth;